Quantcast
Channel: How to combine image in specific positions - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 2

How to combine image in specific positions

$
0
0

Daily I make an image composition with background (background) in alpha channel in the following dimensions: 558px (length) and 465px (height)

background=Import["https://i.stack.imgur.com/TWwdW.png"];

I always have an image with pixels left over that I want to insert in the lower left corner of the image that I usually call img1:

img1=Import["https://i.stack.imgur.com/hSNbn.png"];

enter image description here

I always have an image with pixels left over that I want to insert in the upper left corner of the image that I usually call img2:

enter image description here

Usually, both images are larger than the area of the final image (background). And I eliminate the background and do a better framing.

img1Fit=ImageCrop[RemoveBackground[img1,White]];img2Fit=ImageCrop[RemoveBackground[img2,White]];

I'm trying to make the bottom layer the image "background" file.

The second layer is the img1Fit file in the lower left corner.

And the third layer is the img2Fit file in the upper right corner.

So that the images img1Fit and img2Fit do not overlap and can be resized so that they are in the background.

I tried a code, but it didn't work ...

finalImage=ImageCompose[background,{ImageResize[img1Fit,{232}],ImageResize[img2Fit,{232}]},{{Left,Bottom},{Right,Top}}]

Expected result (something similar):

enter image description here

Another important information is that the "finalImage" has AlphaChannel = True.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images