Page 1 of 1

Convert cmyk jpg with -sharpen param damage image colors

Posted: 2016-04-07T07:14:04-07:00
by lukasruzicka
Hi,
I probably found bug, when you try to convert cmyk jpeg image and sharpen param is used.

Code: Select all

Version: ImageMagick 6.9.3-1 Q16 x86_64 2016-01-22 http://www.imagemagick.org
Origin image: https://www.dropbox.com/s/0i3i4uzma0y54 ... n.jpg?dl=0

Command, i have used:

Code: Select all

convert cmyk.jpg -thumbnail '1000x1000>' -background white -gravity center  -sharpen 0x0.1 -background white -quality 88 -colorspace sRGB converted.jpg
Result of conversion: https://www.dropbox.com/s/0ykgshyq7jvq0 ... d.jpg?dl=0

If i remove the -sharpen 0x0.1 parameter, it looks better.

Code: Select all

 convert cmyk.jpg -thumbnail '1000x1000>' -background white -gravity center -background white -quality 88 -colorspace sRGB converted.jpg
You can see the result here: https://www.dropbox.com/s/7umtms13l3wur ... n.jpg?dl=0

Older imagick (ImageMagick 6.7.2-7 2015-07-23 Q16) on another server gives me proper results.

Thanks for help.

LR

Re: Convert cmyk jpg with -sharpen param damage image colors

Posted: 2016-04-07T09:20:49-07:00
by magick
ImageMagick is likely sharpening the black channel. Try removing the black channel from the sharpening operation with the -channel CMY option.

Re: Convert cmyk jpg with -sharpen param damage image colors

Posted: 2016-04-07T09:22:50-07:00
by fmw42
I suspect that IM does not process things like -sharpen etc well in CMYK colorspace. I would suggest you convert to sRGB right after reading the input. Best to use profiles.

Both these work for me (unix syntax)

Code: Select all

convert origin.jpg \
-profile /Users/fred/images/profiles/USWebCoatedSWOP.icc \
-profile /Users/fred/images/profiles/sRGB.icc \
-thumbnail '1000x1000>' -background white -gravity center \
-sharpen 0x0.1 -background white -quality 88 converted.jpg

Code: Select all

convert origin.jpg \
-colorspace sRGB \
-thumbnail '1000x1000>' -background white -gravity center \
-sharpen 0x0.1 -background white -quality 88 converted2.jpg