Creating transparent PNG from EPS

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mightyfaulk

Creating transparent PNG from EPS

Post by mightyfaulk »

I know there are several topics concerning this issue, but I've tried all the methods in those topics and they aren't helping me.

Trying to convert an eps to a png with transparent background, however it returns a white background no matter what I command line options I try to use. I can't use -transparent white because the EPS is white!

I am using IM 6.2.8, when I do -verbose I get this:
[ghostscript library] -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -dEPSCrop "-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g398x110" "-r72x72" "-sOutputFile=/tmp/magick-XXe5cwts" "-f/tmp/magick-XXUWoEgV" "-f/tmp/magick-XXnbCR3n"/tmp/magick-XXe5cwts[0] BMP 398x110 398x110+0+0 PseudoClass 256c 1.8e+02kb [1] => /tmp/magick-XXe5cwts[1] BMP 398x110 398x110+0+0 PseudoClass 256c 1.8e+02kb [2] => /tmp/magick-XXe5cwts[2] BMP 398x110 398x110+0+0 PseudoClass 256c 1.8e+02kb [3] => /tmp/magick-XXe5cwts[3] BMP 398x110 398x110+0+0 PseudoClass 256c 1.8e+02kb [4] => ../media/promotional/rc0OSF5zGCXq6pQS.eps PS 398x110 398x110+0+0 DirectClass 1.8e+02kb [5] => ../media/promotional/rc0OSF5zGCXq6pQS.eps=>../media/cache/rc0OSF5zGCXq6pQS.eps.png PS 398x110 398x110+0+0 DirectClass 7.6kb )
The EPS is:
http://distributors.ultimatenutrition.c ... Qsu47Q.eps

Thank you for any help! :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating transparent PNG from EPS

Post by fmw42 »

This works for me on IM 6.6.1.0 Q16 Mac OSX Tiger. Your eps is cmyk, so you have to convert to rgb before reading it.

convert -colorspace RGB hrBlXHT4MoQsu47Q.eps hrBlXHT4MoQsu47Q.png
mightyfaulk

Re: Creating transparent PNG from EPS

Post by mightyfaulk »

tried that too, still getting a white background. i wonder if it has to do with ghost script
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating transparent PNG from EPS

Post by fmw42 »

I am running GS 8.61 which is rather old. Are you sure it is installed correctly? Do you have the GS fonts installed?

convert -list configure

see DELEGATES bzlib fftw fontconfig freetype gs jpeg jng jp2 lcms lqr openexr png tiff x11 xml zlib

Your 6.2.8 IM is over 300 versions behind. I would suggest you upgrade.
mightyfaulk

Re: Creating transparent PNG from EPS

Post by mightyfaulk »

Alright, I uninstalled old IM on my dedicated server and tried installing the latest.. it's working in console, but not in php. If anyone can help me out with that, I'd appreciate it.
I've read on previous forums that IM doesn't install to the same path anymore creating an issue within PHP when using exec().. not sure how to go about correcting it though.

Here's what IM reports when I do convert -list configure

Code: Select all

Path: /usr/local/lib/ImageMagick-6.6.1/config/configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            gcc -std=gnu99 -std=gnu99
CFLAGS        -fopenmp -g -O2 -Wall -W -pthread
CONFIGURE     ./configure  'LDFLAGS=-L/usr/local/lib -Wl,-rpath,/usr/local/lib'
COPYRIGHT     Copyright (C) 1999-2010 ImageMagick Studio LLC
CPPFLAGS      -I/usr/local/include/ImageMagick
CXX           g++
CXXFLAGS      -pthread
DEFS          -DHAVE_CONFIG_H
DELEGATES     
DISTCHECK_CONFIG_FLAGS 'LDFLAGS=-L/usr/local/lib -Wl,-rpath,/usr/local/lib' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fontconfig=no --with-gslib=no --with-fontpath= --with-rsvg=no --with-xml=no
EXEC-PREFIX   /usr/local
HOST          x86_64-unknown-linux-gnu
LDFLAGS       -L/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib
LIB_VERSION   0x661
LIB_VERSION_NUMBER 6,6,1,0
LIBS          -lMagickCore -lm -lgomp -lpthread 
NAME          ImageMagick
PCFLAGS       -fopenmp
PREFIX        /usr/local
QuantumDepth  16
RELEASE_DATE  2010-04-07
VERSION       6.6.1
WEBSITE       http://www.imagemagick.org

Path: [built-in]

Name          Value
-------------------------------------------------------------------------------
NAME          ImageMagick
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating transparent PNG from EPS

Post by fmw42 »

You don't have any delegates installed. If you installed manually from source, you need to get any appropriate delegates, such as libtiff, libpng, libjpg, ghostscript, etc and install those. Then recompile IM.

Or perhaps IM cannot find your delegates as they were installed before somewhere else.

That is the best I can offer. Perhaps some IM expert can help further.
Post Reply