Page 1 of 1

Clipping Path Behaviour is Different for CMYK and RGB conversion EPS to PNG Transparency

Posted: 2015-10-23T07:09:51-07:00
by alexm
I am converting EPS files with a clipping path to PNG. The aim is to convert the clipping path to PNG transparency.

Earlier I found in this forum a way to do so with two convert calls.

No I found that these two calls are only working for RGB files. In CMYK I get a white (on some images a black background).

For CMYK files a single call to convert works. Is this intended or a bug?

The test images are here:

https://cloud.imi.de/public.php?service ... 20bac57f91

Code: Select all

convert -version

Version: ImageMagick 6.9.2-3 Q16 x86_64 2015-10-09 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff wmf x xml zlib


2-liner - Fails for CMYK to create transparency

Code: Select all

Test 'testClippingToTransparency with data set #0' ended and took 2.0764911174774 seconds.
# convert -density 72x72 "tests/test-pictures/dreieck_cmyk_pfad_72.eps"[0] -profile Adobe/CMYK/USWebUncoated.icc -profile color.org/sRGB_IEC61966-2-1_black_scaled.icc -alpha set -channel alpha -clip -negate /tmp/ImageConvert6629336XptiW.png
# convert "/tmp/ImageConvert6629336XptiW.png"[0] -channel alpha -negate tests/artifacts/testClippingToTransparency-dreieck_cmyk_pfad_72.eps.png
Test 'testClippingToTransparency with data set #1' ended and took 0.58007907867432 seconds.
# convert -density 300x300 "tests/test-pictures/dreieck_rgb_pfad_300.eps"[0] -alpha set -channel alpha -clip -negate /tmp/ImageConvert6648z1ZbvW.png
# convert "/tmp/ImageConvert6648z1ZbvW.png"[0] -channel alpha -negate tests/artifacts/testClippingToTransparency-dreieck_rgb_pfad_300.eps.png
Onliner - Fails for RGB to create transparency

Code: Select all

Test 'testClippingToTransparency with data set #0' ended and took 1.8465621471405 seconds.
# convert -density 72x72 "tests/test-pictures/dreieck_cmyk_pfad_72.eps"[0] -profile Adobe/CMYK/USWebUncoated.icc -profile color.org/sRGB_IEC61966-2-1_black_scaled.icc -alpha set -channel alpha tests/artifacts/testClippingToTransparency-dreieck_cmyk_pfad_72.eps.png
Test 'testClippingToTransparency with data set #1' ended and took 0.2752628326416 seconds.
# convert -density 300x300 "tests/test-pictures/dreieck_rgb_pfad_300.eps"[0] -alpha set -channel alpha tests/artifacts/testClippingToTransparency-dreieck_rgb_pfad_300.eps.png
So the current fix in my application is a hybrid mode, choosing the method based on the color profile:

Code: Select all

Test 'testClippingToTransparency with data set #0' ended and took 2.0789110660553 seconds.
# convert -density 72x72 "tests/test-pictures/dreieck_cmyk_pfad_72.eps"[0] -profile Adobe/CMYK/USWebUncoated.icc -profile color.org/sRGB_IEC61966-2-1_black_scaled.icc -alpha set -channel alpha -clip -negate /tmp/ImageConvert556722gqR1CV.png
# convert "/tmp/ImageConvert556722gqR1CV.png"[0] -channel alpha -negate tests/artifacts/testClippingToTransparency-dreieck_cmyk_pfad_72.eps.png
Test 'testClippingToTransparency with data set #1' ended and took 0.28133392333984 seconds.
# convert -density 300x300 "tests/test-pictures/dreieck_rgb_pfad_300.eps"[0] -alpha set -channel alpha tests/artifacts/testClippingToTransparency-dreieck_rgb_pfad_300.eps.png

Re: Clipping Path Behaviour is Different for CMYK and RGB conversion EPS to PNG Transparency

Posted: 2015-10-29T17:27:22-07:00
by magick
Add -colorspace sRGB to your command-line before the CMYK EPS filename. Does that fix the problem?