possible bug converting CMYK tiff to RGB tiff
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
possible bug converting CMYK tiff to RGB tiff
See viewtopic.php?f=1&t=28259#p125363 and subsequent posts for best explanation. The original image is at the very first post in the topic.
Re: possible bug converting CMYK tiff to RGB tiff
It looks like Photoshop displays the original CMYK colors, not the sRGB colors. To achieve, try
Why the negate? Because Photoshop has historically (and incorrectly) reversed the CMYK color values.
- convert Original.tif -negate new.tif
display new.tif
- convert Original.tif -negate -colorspace sRGB new.tif
display new.tif
Why the negate? Because Photoshop has historically (and incorrectly) reversed the CMYK color values.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug converting CMYK tiff to RGB tiff
This does not work for me. It still has the orange color rather than brown.magick wrote:convert Original.tif -negate -colorspace sRGB new.tif
see viewtopic.php?f=1&t=28259&start=15#p125368
Re: possible bug converting CMYK tiff to RGB tiff
The CMYK colors appear to match those of whatIseeinPhotoshop.png so that's our baseline color values. For sRGB you would need a CMYK to sRGB color transform that matches that of Photoshop. Since there is a conflict with the associated color profiles, you can eliminate one or use your own. For example:
- convert Original.tif +profile "*" -profile cmyk.icm -profile sRGB.icm new.tif
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug converting CMYK tiff to RGB tiff
These two work by stripping all profiles as I said before
But I cannot just strip the imbedded USWebCoatedSwop.icc profile and get it to work as follows:
IM either needs to reset the Photoshop data to properly identify that it is then sRGB and not CMYK or it needs some way to strip the Photoshop data alone, so that any color profile and clip paths can remain.
I had tried +profile "xmp" and +profile "tiff", but neither of them worked. So the problem is in the photoshop data, which has no profile listed in the file. I do not know where that data is stored, but -strip or +profile "*" does get rid of it.
Code: Select all
convert Original.tif[0] -strip -profile /Users/fred/images/profiles/USWebCoatedSwop.icc -profile /Users/fred/images/profiles/sRGB.icc Original_rgb2.tif
Code: Select all
convert Original.tif[0] +profile "*" -profile /Users/fred/images/profiles/USWebCoatedSwop.icc -profile /Users/fred/images/profiles/sRGB.icc Original_rgb2.tif
Code: Select all
convert Original.tif[0] +profile "icc" -profile /Users/fred/images/profiles/USWebCoatedSwop.icc -profile /Users/fred/images/profiles/sRGB.icc Original_rgb2.tif
IM either needs to reset the Photoshop data to properly identify that it is then sRGB and not CMYK or it needs some way to strip the Photoshop data alone, so that any color profile and clip paths can remain.
I had tried +profile "xmp" and +profile "tiff", but neither of them worked. So the problem is in the photoshop data, which has no profile listed in the file. I do not know where that data is stored, but -strip or +profile "*" does get rid of it.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug converting CMYK tiff to RGB tiff
CORRECTION: The above commands to strip profiles do work to get the colors correct, but the transparency is lost.
Re: possible bug converting CMYK tiff to RGB tiff
+profile "tiff" does nothing. You have to select from the following shown in idntify -verbosefmw42 wrote: I had tried +profile "xmp" and +profile "tiff", but neither of them worked. So the problem is in the photoshop data, which has no profile listed in the file. I do not know where that data is stored, but -strip or +profile "*" does get rid of it.
...
Profiles:
Profile-8bim: 7414 bytes
Profile-icc: 557168 bytes
Profile-tiff:37724: 180740 bytes
Profile-xmp: 36672 bytes
+profile tiff:37724 will remove photoshop layer, but photoshop-only transparency information is also in it.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug converting CMYK tiff to RGB tiff
Thanks for the information about +profile tiff:37724. But we need a way to remove the colorspace information in the photoshop data without destroying the transparency.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug converting CMYK tiff to RGB tiff
This finally works.
But it should not be necessary to for this to be so complicated. IM should do a proper conversion in a simple command.
But it should not be necessary to for this to be so complicated. IM should do a proper conversion in a simple command.
Code: Select all
convert -quiet -respect-parenthesis Original.tif \
\( -clone 0 -evaluate set 0 \) \
\( -clone 1 -alpha extract \) \
\( -clone 2 -clone 3 -layers merge +repage \) \
-delete 2,3 \
\( -clone 0 +profile tiff:37724 -alpha off \
-profile /Users/fred/images/profiles/USWebCoatedSwop.icc \
-profile /Users/fred/images/profiles/sRGB.icc +repage \) \
-delete 0,1 \
+swap -alpha off -compose copy_opacity -composite \
-define tiff:alpha=associated \
Original_srgb.tif