Page 1 of 1

Convert CMYK EPS to RGB PNG maintaining transparency

Posted: 2011-07-27T03:11:32-07:00
by michrome
Hello all

Really hoping someone can help me as I've been looking at this for ages and just can't quite get to the answer. I'm trying to convert a EPS CMYK file with a transparent background to a RGB PNG. Sounds simple, right? I started with this command:

Code: Select all

convert -colorspace rgb input_cmyk_transparent.eps output_rgb.png
The transparency remained but the colours look terrible. I thought this was down to profiles, so I then tried specifying the profiles I wanted to use with:

Code: Select all

convert input_cmyk_transparent.eps output_rgb.png -profile USWebCoatedSWOP.icc -profile SRGB.icc output_rgb.png
The colours look perfect but now I have lost the transparency (it's turned to white). So, next I tried:

Code: Select all

convert -colorspace rgb input_cmyk_transparent.eps output_rgb.png -profile USWebCoatedSWOP.icc -profile SRGB.icc output_rgb.png
However, this gives the error:

Code: Select all

color profile operates on another colorspace `icc'
I don't want to use an option like "-transparent white" as I have white in some of my images that I want to keep as white.

Does anyone what the command I need is? Below are the links to the EPS and ICC files I am using.

Your help is really appreciated. Thanks!


INPUT EPS FILE - http://myfreefilehosting.com/f/401e91a1b2_0.36MB
COLOR PROFILE (CMYK) - USWebCoatedSWOP.icc http://myfreefilehosting.com/f/95908d3385_0.53MB
COLOR PROFILE (RGB) - sRGB.icc http://myfreefilehosting.com/f/1f4d8771eb_0.1MB

Re: Convert CMYK EPS to RGB PNG maintaining transparency

Posted: 2011-07-27T10:19:49-07:00
by fmw42
Your input image has no transparency:

identify -verbose input_cmyk_transparent.eps
Image: input_cmyk_transparent.eps
Format: PS (PostScript)
Class: DirectClass
Geometry: 396x90+0+0
Resolution: 72x72
Print size: 5.5x1.25
Units: Undefined
Type: ColorSeparation
Base type: ColorSeparation
Endianess: Undefined
Colorspace: CMYK
Depth: 16/8-bit
Channel depth:
cyan: 8-bit
magenta: 8-bit
yellow: 8-bit
black: 1-bit
Channel statistics:
Cyan:
min: 0 (0)
max: 65535 (1)
mean: 8629.97 (0.131685)
standard deviation: 20233 (0.308736)
kurtosis: 2.87587
skewness: 2.13427
Magenta:
min: 0 (0)
max: 51657 (0.788235)
mean: 5729.41 (0.0874252)
standard deviation: 15023.3 (0.229241)
kurtosis: 4.41957
skewness: 2.46726
Yellow:
min: 0 (0)
max: 28270 (0.431373)
mean: 616.85 (0.00941253)
standard deviation: 3690.38 (0.0563115)
kurtosis: 36.7076
skewness: 6.11554
Black:
min: 0 (0)
max: 0 (0)
mean: 0 (0)
standard deviation: -0 (-0)
kurtosis: 0
skewness: 0
Image statistics:
Overall:
min: 0 (0)
max: 65535 (1)
mean: 3744.06 (0.0571307)
standard deviation: 12734.7 (0.19432)
kurtosis: 14.5263
skewness: 4.0685
Total ink density: 179%
Colors: 255
Histogram:
29193: ( 0, 0, 0, 0) #0000000000000000 black
198: ( 4369, 3341, 0, 0) #11110D0D00000000 cmyk(17,13,0,0)
1: ( 4626, 0, 2056, 0) #1212000008080000 cmyk(18,0,8,0)
2: ( 5911, 0, 2570, 0) #171700000A0A0000 cmyk(23,0,10,0)


Something like this should work if you do have transparency:


convert input_cmyk_transparent.eps \
-profile Profiles/USWebCoatedSWOP.icc \
-profile Profiles/sRGB.icc \
PNG32:input_cmyk2rgb_transparent.png

when I ran the above, I got a fully opaque alpha channel in the result, which is to be expected as you input was fully opaque.

Re: Convert CMYK EPS to RGB PNG maintaining transparency

Posted: 2011-07-28T08:44:24-07:00
by michrome
Hey Fred

Thanks so much for the quick reply. I'm not an image expert so I suspect I've used the term "transparent" incorrectly. Nevertheless, if I open the input file using Photoshop or Illustrator, it has a see-through background (displayed as little white and grey squares): as far as my client is concerned it has a transparent background!

When I try the command you suggest (including the PNG32), the resulting image I get still has a white background. I need the background to remain see-through as I want to put it on top of another image (composite).

Also, if I run the following then the result does have a see-through background but the colours are way off:

Code: Select all

convert -colorspace rgb input_cmyk_transparent.eps output_rgb.png
Do you have any other ideas?

Many thanks.

Re: Convert CMYK EPS to RGB PNG maintaining transparency

Posted: 2011-07-28T09:36:16-07:00
by fmw42
Photoshop has two kinds of transparency -- background and alpha. Unfortunately IM can only use one, which is alpha transparency. So if the photoshop file only has background transparency (with the checkerboard background), IM will not know about it. Hopefully this will be something addressed in the current IM 7 development effort going on now in pre-alpha stage.

If you can change your file in photoshop to use alpha channel transparency rather than background transparency, then IM should be able to handle it.