This article is relevant to versions of AssetBank prior to 3.1756. Beyond this, EPS transparency is supported by default - although making the included change to the delegates.xml file may improve the CMYK conversion quality.
Problem
EPS/PSD/AI assets might have a transparent background which is not being preserved when converting to formats supporting transparency (e.g. PNG format). This is especially prevalent for CMYK assets where the colour may be incorrectly converted.
Cause
Asset Bank uses Ghostscript (via ImageMagick) to convert EPS and AI images to different formats. By default, Ghostscript converts them using a "device" which does not support alpha channel on conversion.
Solution
Amend ImageMagick configuration on the Asset Bank server in order to make GhostScript convert using a "device" that supports alpha channel.
First locate the path of the delegates.xml file for your ImageMagick installation.
On Windows
The file can be found inside the ImageMagick installation folder, i.e.:
C:\Program Files\ImageMagick\delegates.xml
On Linux
Run the following and look for the CONFIGURE_PATH path in the first lines of the resulting output:
$ convert -list configure
This will give you the directory that contains delegates.xml. eg:
CONFIGURE_PATH /usr/local/etc/ImageMagick-6/
Amend 'delegates.xml'
Edit delegates.xml with your favourite editor and locate the following line:
<delegate decode="ps:cmyk" stealth="True" command=""/opt/local/bin/gsx"
-q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000
-dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pamcmyk32"
-dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s"
%s "-sOutputFile=%s" "-f%s" "-f%s""/>
replace pamcmyk32 (or 'pam', depending on what is there) with pngalpha so that the resulting line would be:
<delegate decode="ps:cmyk" stealth="True" command=""/opt/local/bin/gsx"
-q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000
-dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha"
-dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s"
%s "-sOutputFile=%s" "-f%s" "-f%s""/>
'Spot Colors'
If you are still experiencing issues with the image/thumbnails being generated by Asset Bank, it is worth checking whether your image uses 'Spot Colors'. If this is the case then the resulting image will not display correctly - in extreme cases the image may have a single flat colour. This is a consequence of ImageMagick not supporting Spot Colors, meaning this is not something that currently has a solution.
In this case, the best option is to replace the thumbnail manually with a version that will display correctly and then advise your users to download the original file.
Comments
0 comments
Please sign in to leave a comment.