blurred CMYK JPEGs when using color management

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

blurred CMYK JPEGs when using color management

Post by axelrose »

Hello all,

I observe some unwanted blurring when I convert an image from RGB JPEG to CMYK JPEG.

This can be seen in screenshot taken from Photoshop, input upper left,
output lower left:Image

If I leave out color management or if I convert from one RGB profile
to another or if the image input is smaller all runs fine.
It doesn't make a difference whether I use QuantumDepth 16 or 32
of if I use littlecms or littlecms2

Code: Select all

 > convert -version
Version: ImageMagick 6.6.9-4 2011-04-14 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP OpenCL  

> otool -L `which convert`
/Users/ar/bin/convert:
	/tools/ImageMagick-6.6.9-4/lib/libMagickCore.4.dylib (compatibility version 5.0.0, current version 5.1.0)
	/tools/ImageMagick-6.6.9-4/lib/libMagickWand.4.dylib (compatibility version 5.0.0, current version 5.1.0)
	/tools/ImageMagick-6.6.9-4/lib/liblcms2.2.dylib (compatibility version 3.0.0, current version 3.1.0)
	/tools/ImageMagick-6.6.9-4/lib/libtiff.3.dylib (compatibility version 13.0.0, current version 13.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
	/tools/ImageMagick-6.6.9-4/lib/libfreetype.6.dylib (compatibility version 13.0.0, current version 13.2.0)
	/tools/ImageMagick-6.6.9-4/lib/libjasper.1.dylib (compatibility version 2.0.0, current version 2.0.0)
	/tools/ImageMagick-6.6.9-4/lib/libjpeg.8.dylib (compatibility version 12.0.0, current version 12.0.0)
	/tools/ImageMagick-6.6.9-4/lib/libpng15.15.dylib (compatibility version 18.0.0, current version 18.0.0)
	/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
	/tools/ImageMagick-6.6.9-4/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.8.0)
	/tools/ImageMagick-6.6.9-4/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
	/tools/ImageMagick-6.6.9-4/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libclparser.dylib (compatibility version 1.0.0, current version 1.0.0)
This is the script I used for testing:

Code: Select all

IN=sample.jpg
test -r $IN || (echo "not readable: '$IN'"; exit 1)

PROFPATH=/Users/me/iccprofiles
test -d $PROFPATH || (echo "not a dir: '$PROFPATH'"; exit 1)
RGBICC=$PROFPATH/AdobeRGB1998.icc
test -r $RGBICC || (echo "not readable: '$RGBICC'"; exit 1)
RGBICC2=$PROFPATH/eciRGB_v2.icc
test -r $RGBICC2 || (echo "not readable: '$RGBICC2'"; exit 1)

CMYKICC=$PROFPATH/SWOP2006_Coated5v2.icc
test -r $CMYKICC || (echo "not readable: '$CMYKICC'"; exit 1)
OUT1=$IN-no-icc.jpg
OUT2=$IN-cmyk-icc.jpg
OUT3=$IN-rgb-icc.jpg

rm -f $OUT1 $OUT2 $OUT3

# not using any color management
/tools/ImageMagick-6.6.9-4/bin/convert jpg:$IN -quality 100 -depth 8 $OUT1

# using ICC profiles to match from RGB to CMYK
/tools/ImageMagick-6.6.9-4/bin/convert jpg:$IN -quality 100  \
-profile $RGBICC -profile $CMYKICC -depth 8 $OUT2

# using ICC profiles to match from one RGB to another RGB

/tools/ImageMagick-6.6.9-4/bin/convert jpg:$IN -quality 100  \
-profile $RGBICC -profile $RGBICC2 -depth 8 $OUT3

file $OUT1 $OUT2 $OUT3
The input file "sample.jpg" is http://dl.dropbox.com/u/84530/IM/sample.jpg

Can anybody confirm if this is a bug?

Thanks, Axel.
blueklein76
Posts: 4
Joined: 2011-04-14T07:08:19-07:00
Authentication code: 8675308

Re: blurred CMYK JPEGs when using color management

Post by blueklein76 »

I'm seeing the same thing when applying an ICC profile. When outputting as a JPEG the images turn crazy blurry, but if you save as a different file format they are fine. I guess this must be a bug.
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Re: blurred CMYK JPEGs when using color management

Post by axelrose »

A cumbersome but possible workaround is to go from RGB JPEG to CMYK TIFF and from there to CMYK JPEG.

No blurring anymore.
ccampbell
Posts: 4
Joined: 2011-03-16T15:14:07-07:00
Authentication code: 8675308

Re: blurred CMYK JPEGs when using color management

Post by ccampbell »

Use identify to check the jpeg:subsampling-factor property. Subsampling values other than 1x1 are not valid for CMYK JPEGs and can result in this sort of blurring.

I would think ImageMagick should reset this when you convert an RGB JPEG to CMYK, but it doesn't seem to (at least in v.6.6.8).
blueklein76
Posts: 4
Joined: 2011-04-14T07:08:19-07:00
Authentication code: 8675308

Re: blurred CMYK JPEGs when using color management

Post by blueklein76 »

This issue seems to have been resolved at version 6.8.2-4 with the change log entry listed as:

2013-02-02 6.8.2-4 Cristy - Do not subsample raw CMYK JPEG images (reference viewtopic.php?f=3&t=22731).
Post Reply