Single combined command != multiple commands
Posted: 2012-11-20T08:18:12-07:00
Hi,
I'm using IM v6.8.0-3, and I have a case in which the outcome of multiple commands isn't the same as the output of a combined command.
I have two 300x300 images, img1.jpg and img2.png (the second with transparency). Using the following commands:
produces an image with white where there was transparency. Combining the two:
produces a similar image, but the transparent areas are not white (they are black, but I'm not sure this is not "garbage" black from the conversion to JPG).
Shouldn't the result be identical?
As a side note, what I'm trying to do is combine the two images so that wherever the PNG is transparent would be white, and everywhere else would be the content of the JPG. Any idea how to do this other than the way I'm doing it?
Thanks,
Yoav
I'm using IM v6.8.0-3, and I have a case in which the outcome of multiple commands isn't the same as the output of a combined command.
I have two 300x300 images, img1.jpg and img2.png (the second with transparency). Using the following commands:
Code: Select all
convert img2.png img1.jpg -compose In -composite out.png
convert out.png -background white -extent 0x0 +matte out.jpg
Code: Select all
convert img2.png img1.jpg -compose In -composite -background white -extent 0x0 +matte out.jpg
Shouldn't the result be identical?
As a side note, what I'm trying to do is combine the two images so that wherever the PNG is transparent would be white, and everywhere else would be the content of the JPG. Any idea how to do this other than the way I'm doing it?
Thanks,
Yoav