Page 1 of 1

composite tool for print image

Posted: 2010-11-12T15:47:41-07:00
by frodfigu
Hi! Great tool (imagemagick) and fantastic forum

Here is my question:

I have a problem with the function-composite, need to generate a composite of several images for printing, but the final composition loses quality in color (something like the saturation of images that make up the composition) How I can fix it?

i´m using this code:

Code: Select all

$cmd =\" -size 4714x3141 xc:#FFFFFF -density
266x266 photo1.png -geometry +100+100  -
composite photo2.png -geometry +500+100 \".
\" -composite\";

exec(\"convert $cmd background.jpg\");
Thank you for your response.

Re: composite tool for print image

Posted: 2010-11-12T17:35:59-07:00
by fmw42
You might want to use something like

convert image1 image2 -background white -flatten result

see http://www.imagemagick.org/Usage/layers/#flatten

but it may be a totally different issue.

Question: do either of your images have transparency?

Perhaps you could provide links to your two images (if not too large or a smaller set) and to your current result so others can test your commands and other variations.

Also what version of IM are you using. If old, perhaps upgrade.

Re: composite tool for print image

Posted: 2010-12-12T16:13:29-07:00
by frodfigu
Hi, thank you very much for your response.

Here are the example of the problem.

I used the flatten command:

convert -size 1181x1575 xc:#FFFFFF -density 200x200 -quality 100 -page +0+0 tempack/1.jpg -page +0+810 tempack/2.jpg -flatten tempack/pack1.jpg

this is the original file: Image

and this one is the layered file with the colour problem: Image

See the color diferences.... that´s the problem!!!

Than you very much for your responses.

P.D: I´m using this Imagemagick version: ImageMagick 6.5.6-8

Re: composite tool for print image

Posted: 2010-12-12T17:45:56-07:00
by fmw42
Can you post links to your two input images so others can test. It may be an IM version issue or something else. Have you tried upgrading to the current version? Note that using jpg for output will change the result somewhat as JPG is not lossless even with -quality 100.

Re: composite tool for print image

Posted: 2010-12-12T18:01:54-07:00
by anthony
I also am seeing some major darkening of colors in some operations

for example::

Code: Select all

  convert rose: -contrast -contrast -contrast show:
Is producing a darkened image, when really it should only have more contrast (color spread)
Such as produced by...

Code: Select all

convert rose: -level 20,80% show:
It is not just -contrast either, but quite a number of global color processing operators that seems to be affected.

Re: composite tool for print image

Posted: 2010-12-12T18:07:22-07:00
by anthony
ASIDE: -flatten will set a background color for you, as such you can simplify by doing this instead.

Code: Select all

convert  -page 1181x1575+0+0 tempack/1.jpg \
             -page +0+810 tempack/2.jpg \
             -background white -flatten \
             -density 200x200 -quality 100 tempack/pack1.jpg
The virtual canvas size of the first image defines the final size
http://www.imagemagick.org/Usage/layers/#flatten

Re: composite tool for print image

Posted: 2010-12-13T05:46:01-07:00
by frodfigu
Here are the original file:

Image

external link: http://www.orlasprolabs.com/examplesfla ... alfile.jpg


I think the problem is not JPG I can make a -resize, -rotate and even can´t see color´s changes.

The problem appear when it is a composite of several images....

I can´t upload the version because I´m working on a webhosting

Somebody can try this on a newer version?

Re: composite tool for print image

Posted: 2010-12-13T23:42:48-07:00
by anthony
Can you crop a section of the image that has the color distortion and append them side by side.
It is hard to see the color distortions you are taking about.

Re: composite tool for print image

Posted: 2010-12-14T17:22:19-07:00
by frodfigu
Uhm... I think I know where the problem ... the color profiles, because when I open the file "pack1.jpg" in photoshop it shows me a message like that has no color profile associated with the image.

When I save that file with the AdobeRGB profile, the color returns to normal!

But I don´t know how to turn the image "pack1.jpg" the AdobeRGB color profile with imagemagick ... anyone can help me?

Re: composite tool for print image

Posted: 2010-12-14T19:24:49-07:00
by anthony