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?".
hassan.nabeel
Posts: 2 Joined: 2012-08-08T22:47:41-07:00
Authentication code: 67789
Post
by hassan.nabeel » 2012-08-08T23:13:01-07:00
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
Here is the screenshot from IM
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-08-09T13:36:28-07:00
try adding +repage to your command to remove any possible virtual canvas
hassan.nabeel
Posts: 2 Joined: 2012-08-08T22:47:41-07:00
Authentication code: 67789
Post
by hassan.nabeel » 2012-08-09T20:37:09-07:00
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.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-08-09T21:56:52-07:00
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.
flopsylove
Posts: 1 Joined: 2012-08-10T04:42:14-07:00
Authentication code: 67789
Post
by flopsylove » 2012-08-10T04:44:23-07:00
Any news on this bug yet? I have been having similar difficulties and can't find an answer on how to sort it anywhere
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2012-08-10T05:07:58-07:00
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.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-08-10T10:11:16-07:00
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?