Page 1 of 1

Problem saturating a CMYK image

Posted: 2017-08-09T18:08:59-07:00
by banisco
I'm trying to do a simple saturation bump on a CMYK image. I'm starting with a PNG image containing an embedded Adobe RGB profile, convert to CMYK with a provided color profile, then modulate the saturation by 20%:

Code: Select all

convert sample.png -profile USWebCoatedSWOP.icc sample_CMYK.tif
convert sample_CMYK.tif -modulate 100,120 sample_CMYK_saturated.tif 
For some reason the reds get shifted? I'm not seeing this result when using the sample test.png image:

Code: Select all

convert test.png -profile USWebCoatedSWOP.icc test_CMYK.tif
convert test_CMYK.tif -modulate 100,120 test_CMYK_saturated.tif 
My sample files should be accessible here: https://www.dropbox.com/sh/boo61pwnm7iq ... q8tma?dl=0

Per the examples page http://www.imagemagick.org/Usage/color_mods/#modulate I am assuming I don't need to perform any additional colorspace conversion (to/from HSL occurs automatically?)

Version: ImageMagick 7.0.6-3 Q16 x64 2017-07-24 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

Re: Problem saturating a CMYK image

Posted: 2017-08-09T18:55:09-07:00
by fmw42
You should modulate in sRGB and then convert to CMYK. Modulate assumes you start with sRGB and converts to HSL (by default) to do the saturation and then converts back to sRGB

Re: Problem saturating a CMYK image

Posted: 2017-08-09T19:13:05-07:00
by banisco
Thanks, that was the piece I was missing. I was hoping I could perform the modulation in CMYK in order to emulate a workflow from Photoshop, where this is possible. This particular workflow does a lot in CMYK mode and I was hoping to avoid a lot of CMYK -> sRGB -> CMYK conversions.

Re: Problem saturating a CMYK image

Posted: 2017-08-09T19:39:46-07:00
by fmw42
Unfortunately, Imagemagick needs to do most of its processing in sRGB to get reliable results. There are some things you can do in CMYK, but I always try to process in sRGB and convert at the end if needed to CMYK using profiles.