Compositing applies color profile to the entire final image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
zeeg
Posts: 1
Joined: 2014-10-06T18:41:19-07:00
Authentication code: 6789

Compositing applies color profile to the entire final image

Post by zeeg »

Say I have two images, where one of them contains a color profile, and I run something like the following:

Code: Select all

composite -gravity center in1.jpg in2.jpg out.jpg

This has the effect of applying that color profile to the entire output image, which can sometimes drastically affect the colors of the second image. In the final image, is there any way to preserve the profile's effect on its own image, but not have it effect the other? If not, are there any workarounds or alternatives I could look into?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compositing applies color profile to the entire final im

Post by snibgo »

I strongly suggest you convert both images into the same colorspace before the composition. For example, using the "convert" command:

Code: Select all

convert in1.jpg in2.jpg -profile sRGB.icc -gravity Center -composite out.jpg
With more work, you could convert the image without a profile into the same colorspace as the one with the profile.
snibgo's IM pages: im.snibgo.com
Post Reply