[bash] Problem when overlaying two images : result is darker
Posted: 2013-05-19T10:23:28-07:00
Hi everybody,
I'm trying to overlay two *.jpg images;
The first one is a photo.
The second is created within IM by using a convert command with -sparse-color over a series of RGB values and X,Y coordinates.
This second image is bigger (higher and wider).
Using bash, I tried to place the photo over the second image (and store the results in the same file as the photo), with this command :
but the result is significantly "darker" than the original picture.
And when using Dst_over ;
the photo is OK (it looks exactly the same as the original), but, as the bigger image is no more the destination image, the result image is cropped to the size of the "smallest", i.e. the photo. Which is not what I want.
But the colours look right with this method.
I can't figure what is wrong with such a simple composite command, neither why there is a difference between these two methods.
(And as I don not know if this is a bug, I posted this message in the main user cat)
Any help would be appreciated.
Thanks a lot !
(I am using Ubuntu 12.04 with ImageMagick 6.6.9-7 2012-08-17 Q16 (simply, the repository version) ).
I'm trying to overlay two *.jpg images;
The first one is a photo.
The second is created within IM by using a convert command with -sparse-color over a series of RGB values and X,Y coordinates.
This second image is bigger (higher and wider).
Using bash, I tried to place the photo over the second image (and store the results in the same file as the photo), with this command :
Code: Select all
composite -gravity northwest -geometry +20+20 "${photo_path}" "${sparse_color_image_path}" "${photo_path}"
And when using Dst_over ;
Code: Select all
composite -compose Dst_over -gravity northwest -geometry +20+20 "${sparse_color_image_path}" "${photo_path}" "${photo_path}"
But the colours look right with this method.
I can't figure what is wrong with such a simple composite command, neither why there is a difference between these two methods.
(And as I don not know if this is a bug, I posted this message in the main user cat)
Any help would be appreciated.
Thanks a lot !
(I am using Ubuntu 12.04 with ImageMagick 6.6.9-7 2012-08-17 Q16 (simply, the repository version) ).