composite tool for print image

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
frodfigu
Posts: 6
Joined: 2010-11-12T15:43:38-07:00
Authentication code: 8675308

composite tool for print image

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: composite tool for print image

Post 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.
frodfigu
Posts: 6
Joined: 2010-11-12T15:43:38-07:00
Authentication code: 8675308

Re: composite tool for print image

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: composite tool for print image

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: composite tool for print image

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: composite tool for print image

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
frodfigu
Posts: 6
Joined: 2010-11-12T15:43:38-07:00
Authentication code: 8675308

Re: composite tool for print image

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: composite tool for print image

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
frodfigu
Posts: 6
Joined: 2010-11-12T15:43:38-07:00
Authentication code: 8675308

Re: composite tool for print image

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: composite tool for print image

Post by anthony »

Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply