Output image not preserving CMYK color ratios and Blue lines misplaced

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
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Output image not preserving CMYK color ratios and Blue lines misplaced

Post by Carter J »

Hi,

Might be a bug, so posting here again...

We are facing below two issues after resolution change from 72 to 300 for a JPEG-CMYK:

1. CMYK color ratio's of input file and output file differs
2. Blue lines on input image are misplaced in output image (we can view the blue lines in both input image and output image only in Photoshop, below is comparision screenshot).
https://www.dropbox.com/s/bulj08sb3ldlv ... t.jpg?dl=0


For Example: (Given below URL's for both input and output files)
For Input file
CMYK color ratio's at background of BT logo : 100,62,1,1

After conversion:
CMYK color ratio's at background of BT logo : 99,65,7,1

Could anyone suggest what could be the possible cause for above?

Command used:
convert -alpha off -layers merge -units pixelsperinch -resample 300 InputImage.jpg[0] -profile USWebCoatedSWOP.icc -profile USWebCoatedSWOP.icc outputImage.jpg

or

convert -units pixelsperinch -resample 300 InputImage.jpg[0] -profile USWebCoatedSWOP.icc -profile USWebCoatedSWOP.icc outputImage.jpg

or

convert -units pixelsperinch -resample 300 InputImage.jpg[0] -profile USWebCoatedSWOP.icc outputImage.jpg

Even, we are changing colorspaces as some images rot retaining color profiles, applying same profiles for both input/output images

If we remove applying profiles, the output is good and color ratios preserved. We are applying same profile, for output image taking from input image. Here input image contains "USWebCoatedSWOP.icc ", so we are applying same profile for output

input file:
https://www.dropbox.com/s/mpczhilffo1js ... e.jpg?dl=0

output file:
https://www.dropbox.com/s/jllzq3t0ky1we ... e.jpg?dl=0


Any insight?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by fmw42 »

Try using the proper IM syntax where the input image is generally first.

Code: Select all

convert  InputImage.jpg[0] -units pixelsperinch -resample 300  -profile XXX <-profile YYY> outputImage.jpg
You have doubled your -profile with the same profile. That is not good. You should test what kind of profile your input has, if any. If it has a profile, then you only need one CMYK profile. If it has no profile, then it is assumed to be sRGB (unless the colorspace is marked CMYK). If colorspace sRGB, then you need a first sRGB.icc profile in your command line.

I am not sure, but I think IM should carry your input profile over to the output if it has one.


JPG does not support multilayers or multipages, so the [0] is superfluous, but should not hurt in case you have other input formats.

You can find out the profiles and colorspaces by using identify -verbose yourimage.jpg

or via string formats at http://www.imagemagick.org/script/escape.php

see
%[profile:icc] ICC profile info
%[profile:icm] ICM profile info
%[profiles] list of any embedded profiles

Also it is always a good idea to identify your version of IM and platform as syntax may be different and there has been colorspace changes in IM a while back. So if you are on an old version of IM, you might want to upgrade.
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by Carter J »

Hi,

We are tried the same, applying profile for output only (single -profile) and also changed the order of commands, still we are experiencing same issues.

IM versions: 6.8.8.9 (windows), 6.9.0.1 (windows), 6.8.8-7 (Linux)

Command:
convert InputImage.jpg -units pixelsperinch -resample 300 -profile USWebCoatedSWOP.icc outputImage.jpg


identify -format %[profiles] InputImage.jpg
8bim,exif,icc,iptc,xmp

identify -format %[profile:icc] InputImage.jpg
U.S. Web Coated (SWOP) v2

identify -format %[profile:icc] outputImage.jpg[/b]
U.S. Web Coated (SWOP) v2

identify -format %[profiles] outputImage.jpg
8bim,exif,icc,iptc,xmp

Any suggestions?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by fmw42 »

Post your input image to some place like dropbox.com and put the URL here. We would need to examine it and try your commands. Note that 6.9.0.1 is a bad version and should be avoided. Try the latest 6.9.0.6.
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by Carter J »

fmw42 wrote:Post your input image to some place like dropbox.com and put the URL here. We would need to examine it and try your commands. Note that 6.9.0.1 is a bad version and should be avoided. Try the latest 6.9.0.6.
Hi,

Below are the links:

input file:
https://www.dropbox.com/s/mpczhilffo1js ... e.jpg?dl=0

output file:
https://www.dropbox.com/s/jllzq3t0ky1we ... e.jpg?dl=0

We can view blue lines on Input and output files only in Photoshop

Comparison screen shot for input and output:

https://www.dropbox.com/s/bulj08sb3ldlv ... t.jpg?dl=0
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by fmw42 »

I get no steaks/stripes in IM 6.9.0.6 Q16 Mac OSX when I run

Code: Select all

convert InputImage.jpg -units pixelsperinch -resample 300 -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc out1.jpg
My guess is that your older versions have bugs. This has been seen before, but I do not recall the bug report. You could search the forums.

P.S. The link to your output result is broken. But I can see the stripes in your comparison image.

Also I see no path to your profile. So if it is not in the same locations as your image (and current directory), then you need to provide the path to the profile.
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by Carter J »

fmw42 wrote:I get no steaks/stripes in IM 6.9.0.6 Q16 Mac OSX when I run

Code: Select all

convert InputImage.jpg -units pixelsperinch -resample 300 -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc out1.jpg
My guess is that your older versions have bugs. This has been seen before, but I do not recall the bug report. You could search the forums.

P.S. The link to your output result is broken. But I can see the stripes in your comparison image.

Also I see no path to your profile. So if it is not in the same locations as your image (and current directory), then you need to provide the path to the profile.

Hi,

We have tested in latest version (6.9.0-6 Q16 x64) with same command you tried and still same issue exists..

We have ICC profile in same directory

As I described previously, we can see that misplaced blue lines (on both input and output images) only in Photoshop..

Below is the link for output file for reference:
https://www.dropbox.com/s/zmzgzdw0zckxq ... 5.jpg?dl=0

Any insight?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by fmw42 »

If it is in the input file, then the file is corrupt. If IM does not show it and PS does, then I guess you need to ask on some PS forum. Photoshop keeps certain data proprietary that only it generally reads. The stripes could be hidden in those areas.

I can see two blue stripes near the bottom of the image in my PS (CS), but not in IM or Mac Preview.

If I strip all the meta data (profiles, etc), then the stripes do not show in PS.

So they are in the meta data, perhaps the clip path or one of the profiles. You can selective remove profiles using +profile. see http://www.imagemagick.org/Usage/formats/#profiles. Perhaps you can isolate it.
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by Carter J »

fmw42 wrote:If it is in the input file, then the file is corrupt. If IM does not show it and PS does, then I guess you need to ask on some PS forum. Photoshop keeps certain data proprietary that only it generally reads. The stripes could be hidden in those areas.

I can see two blue stripes near the bottom of the image in my PS (CS), but not in IM or Mac Preview.

If I strip all the meta data (profiles, etc), then the stripes do not show in PS.

So they are in the meta data, perhaps the clip path or one of the profiles. You can selective remove profiles using +profile. see http://www.imagemagick.org/Usage/formats/#profiles. Perhaps you can isolate it.

We are using below command:
A. convert -units pixelsperinch -resample 300 InputImage.jpg[0] -profile USWebCoatedSWOP.icc outputImage.jpg


As described in question,
If we remove applying profiles (using below command), the output is good (blue lines are in place) and color ratios preserved. We are applying same profile, for output image taking from input image. Here input image contains "USWebCoatedSWOP.icc ", so we are applying same profile for output
Command:
B. convert -units pixelsperinch -resample 300 InputImage.jpg[0] outputImage.jpg

What differs two commands in view of IM, we are applying same profile once again for output image (For some images, IM doesn't carrying profiles to ouptut images, so we are applying once again using "-profile").

For other images applying profiles command (command A) working fine without issues, only for this image it resulting bad image

Any insight?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by fmw42 »

Try using the more proper IM syntax with the input image first as per my example earlier, which worked for me. See if that helps. Otherwise, I suggest you upgrade IM and your libjpeg delegate
convert InputImage.jpg[0] -units pixelsperinch -resample 300 -profile USWebCoatedSWOP.icc outputImage.jpg
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by Carter J »

fmw42 wrote:Try using the more proper IM syntax with the input image first as per my example earlier, which worked for me. See if that helps. Otherwise, I suggest you upgrade IM and your libjpeg delegate
convert InputImage.jpg[0] -units pixelsperinch -resample 300 -profile USWebCoatedSWOP.icc outputImage.jpg

Changing the order of commands not worked.

We are already using IM 6.9.0-6 Q16 x64 on Windows Environment.

Please suggest how to check libjpeg delegate version and how can we upgrade
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by fmw42 »

Please suggest how to check libjpeg delegate version and how can we upgrade
Sorry, I am not a Windows user. So one of the Windows users will have to help on this question
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Output image not preserving CMYK color ratios and Blue lines misplaced

Post by Carter J »

Hi,

Any update on how to preserve CMYK color ratios in the output file (even after applying profiles)?
Post Reply