Page 1 of 2

Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T11:03:07-07:00
by stevenb46
Is there a tick to getting transparency in GIF. I can run:

convert phone.eps phone.gif

and it creates a gif and converts transparency to white

if I do this instead:

convert phone.eps -transparent white phone.gif

it works, but I hear you can't hang you hat on that always working and we may not want white, why can't transparent stay transparent.

Is there a trick to getting these images (created in Illustrator/Photoshop) to convert with transparency.

Running: IM 6.8.9-4 q16 (64-bit) and GhostScript 9.14.

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T11:39:55-07:00
by snibgo
I suggest you supply a link to your EPS.

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T12:19:35-07:00
by stevenb46

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T12:47:28-07:00
by snibgo

Code: Select all

convert -colorspace sRGB phone.eps out.png
That gives me a transparent centre.

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T13:17:19-07:00
by stevenb46
Wow, I tried so many combos. I know you rendered a png, but gif works with this as well. Thanks!

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T13:19:12-07:00
by fmw42
Note that GIF only supports binary transparency (on or off), while PNG supports 8-bit transparency (256 shades)

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T16:26:33-07:00
by stevenb46
GIF is required output.

Is there a way to improve text output; it really is quite awful. If I flatten the image, text gets sharp but I lose transparency and my transparent background from the EPS turns white in the GIF.

Suggestions?

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T16:37:33-07:00
by snibgo
stevenb46 wrote:Is there a way to improve text output; it really is quite awful.
We don't know what command you used, nor what result you got. How do you expect us to respond???

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T16:37:49-07:00
by fmw42
Use supersampling (assuming you used snibgo's command above)

Code: Select all

convert -colorspace sRGB -density 288 phone.eps -resize 25% out.png
Note 72*4=288

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-15T16:41:37-07:00
by GeeMack
stevenb46 wrote: 2017-09-15T16:26:33-07:00Is there a way to improve text output; it really is quite awful. If I flatten the image, text gets sharp but I lose transparency and my transparent background from the EPS turns white in the GIF.
In most cases when you "-flatten" a stack of images, they will be flattened onto a canvas of the background color. In IM the default background color is white. If you want transparent areas to remain transparent you should use "-background none" before "-flatten".

GIFs can't display varying levels of transparency. Transparent is just on or off, so there won't be any anti-aliasing around text in transparent areas.

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-19T13:21:23-07:00
by stevenb46
Text still does not look good. This is where I'm at right now.

convert -colorspace sRGB -density 960 -units PixelsPerInch "image.eps" -resize 10%% -weight Bolder -background none -flatten "image.gif"

Any suggestions?

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-19T13:44:53-07:00
by snibgo
"-weight Bolder" will do nothing. "-background none -flatten" doesn't look useful either.

Without seeing your input or output, it's difficult to comment.

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-21T10:23:40-07:00
by stevenb46
Ok see attached, text in transparent background looks bad when conveted to GIF. Looks better without transparent background

https://www.dropbox.com/s/1yuzzwlwosvz6 ... e.eps?dl=0

Thanks much!

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-22T09:30:31-07:00
by stevenb46
Bump... any suggestions?

Note, as snibgo suggested I dropped, what he said.

now stands at:
convert -colorspace sRGB -density 960 -units PixelsPerInch "filename.eps" -resize 10%% "filename.gif"

Any suggestions?

Re: Converting EPS to GIF, loosing Transparency

Posted: 2017-09-22T09:37:49-07:00
by fmw42
It is not possible to maintain good text quality at such low resolution (resize 10%) when outputting to GIF, since GIF only supports binary transparency. The only way would be to flatten to some background color before resizing and thus lose your transparency. If you need to good quality, you will have to save to PNG or TIF.

If you do not resize, then it may look acceptable.

Code: Select all

convert -colorspace sRGB -density 960 -units PixelsPerInch "image.eps" "image.gif"