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
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
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