Page 1 of 1

Converting from EPS to PNG clips image too much.

Posted: 2016-05-30T09:57:04-07:00
by hiemanshu
When I try to convert from an EPS (that I generated manually) to a PNG. The text is clipped too much at the bottom. Is there any way I can work around these? I'm attaching the two files so you can see what I'm talking about.

Source file : https://www.dropbox.com/s/izj0myr507zlbmy/Test.eps?dl=0

The image when converted to a PNG looks like : https://www.dropbox.com/s/c8f3gmzkymmeboq/Test.png?dl=0

Edit: I have tried different variables to try and get a better result out of Imagemagick. I am using ImageMagick version 6.8.9-10.

Questions I have:

1. Will converting it to a different format before converting it to a PNG help?
2. Will converting it to a much higher resolution and then to the require resolution help?

Re: Converting from EPS to PNG clips image too much.

Posted: 2016-05-30T10:13:54-07:00
by snibgo
It converts fine for me, with IM v6.9.2-5 and Ghostscript 9.15 on Windows 8.1.

What version of GS are you running?

Re: Converting from EPS to PNG clips image too much.

Posted: 2016-05-30T10:40:36-07:00
by hiemanshu
Looks like dropbox doesn't show the file as expected. Posting it to imgur.

Image

The bottom part is cut off in the image as you can see.

I am using GS version 9.05 on Ubuntu.

Re: Converting from EPS to PNG clips image too much.

Posted: 2016-05-30T11:07:14-07:00
by snibgo
With ...

Code: Select all

convert test.eps t.png
... my result is 96x37 pixels. Yours is only 71x27. I suggest you upgrade GS.

Re: Converting from EPS to PNG clips image too much.

Posted: 2016-05-30T11:12:54-07:00
by fmw42
Your original EPS has its anti-aliased bottom edges slightly clipped by the bottom of the image. This seems to be marginally worse in the IM 6.9.4.4. conversion using Ghostscript 9.16 (for me). But I think the issue is that your EPS image is slightly too short vertically for the text you have drawn. I suspect if you give the EPS image a slightly larger vertical dimension, so that it is not not clipping any of the anti-aliasing at the bottom, it will convert better.

I get:

Code: Select all

convert Test.eps Test1.png
identify Test.eps Test1.png
Test.eps PS 96x37 96x37+0+0 16-bit sRGB 1.15KB 0.000u 0:00.000
Test1.png PNG 96x37 96x37+0+0 8-bit sRGB 1.14KB 0.000u 0:00.009

For visual comparison, I used

Code: Select all

convert -density 288 Test.eps -background white -alpha background -flatten Test5.png

Re: Converting from EPS to PNG clips image too much.

Posted: 2016-05-31T09:22:33-07:00
by hiemanshu
Looks like you're right fred. I'm gonna look at the GS and how it generates the eps files. Thank you for the help snibgo and fred!