Problem saturating a CMYK 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
banisco
Posts: 10
Joined: 2016-08-12T15:31:12-07:00
Authentication code: 1151

Problem saturating a CMYK image

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

Re: Problem saturating a CMYK image

Post 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
banisco
Posts: 10
Joined: 2016-08-12T15:31:12-07:00
Authentication code: 1151

Re: Problem saturating a CMYK image

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

Re: Problem saturating a CMYK image

Post 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.
Post Reply