Page 1 of 1

Extra transparent pixels in converting from EPS to PNG

Posted: 2012-08-08T23:13:01-07:00
by hassan.nabeel
Hi,

I have a very simple file that i am trying to convert from EPS to PNG. IM is adding extra transparent pixels to top, bottom and left side of image.

If i convert it using adobe photoshop at 72 DPI it gives me a size of 433x433 image with no extra transparent area.

Here is the original image:
http://www.go2convert.com/uploaded/download/F71zXesV

Screen shot of image from photoshop
Image

Here is the screenshot from IM
Image

Re: Extra transparent pixels in converting from EPS to PNG

Posted: 2012-08-09T13:36:28-07:00
by fmw42
try adding +repage to your command to remove any possible virtual canvas

Re: Extra transparent pixels in converting from EPS to PNG

Posted: 2012-08-09T20:37:09-07:00
by hassan.nabeel
fmw42 wrote:try adding +repage to your command to remove any possible virtual canvas
Thanks for the suggestion. I tried +repage but it didn't have any effect. I can do trim to the image but since its a generic part of the code where users will be uploading their files, so i can't rely on trimming the image.

Re: Extra transparent pixels in converting from EPS to PNG

Posted: 2012-08-09T21:56:52-07:00
by fmw42
Your file is actually EPT format (encapsulated postscript with embedded tiff). Apparently IM is having some problem with that.

I get the same results that you do, namely, other viewers on my Mac (Mac Preview and GraphicConverter) have it cropped to a square.


I tried

convert EPT:gradientcircle.eps gradientcircle.png

But IM is seeing a bounding box in the verbose info: properties in the file, namely,

ps:HiResBoundingBox: 612x792+0+0

I would suggest that you report this to the bugs forum and get the IM developers to check it out.

Re: Extra transparent pixels in converting from EPS to PNG

Posted: 2012-08-10T04:44:23-07:00
by flopsylove
Any news on this bug yet? I have been having similar difficulties and can't find an answer on how to sort it anywhere :cry:

Re: Extra transparent pixels in converting from EPS to PNG

Posted: 2012-08-10T05:07:58-07:00
by magick
ImageMagick scans Postscript looking for the bounding box. Your image includes a bounding box of
  • %%BoundingBox: 0 0 612 792
and that is what it uses for the page size. If you remove this extra bounding box from your Postscript, you get the expected results.

Re: Extra transparent pixels in converting from EPS to PNG

Posted: 2012-08-10T10:11:16-07:00
by fmw42
magick wrote:ImageMagick scans Postscript looking for the bounding box. Your image includes a bounding box of
  • %%BoundingBox: 0 0 612 792
and that is what it uses for the page size. If you remove this extra bounding box from your Postscript, you get the expected results.
It is puzzling that -strip does not help this. I would have thought that perhaps -strip would have removed that.

I also tried

convert -comment "ps:HiResBoundingBox:" gradientcircle.eps gradientcircle.png

Can one override the bounding box entry like this? Have I made a mistake?