Page 1 of 1

Extra pixel while converting

Posted: 2013-08-01T22:39:31-07:00
by deepeshsp
Hi,

I have a eps file, and when I open it in Adobe Illustrator, it says the image is of width 1001.937px and height 1000.03px.

When i simply convert it to a jpg using convert.exe of ImageMagick, (eg: convert.exe a.eps a.jpg), I get an image of 1002 X 1001 px

Please note that the height 1000.03 rounded to 1001, and because of this, I am getting an extra white colored space at the top of the jpg file,

How can I avoid this? Please help.

Re: Extra pixel while converting

Posted: 2013-08-02T10:26:14-07:00
by fmw42
Get the dimensions from Adobe and round or truncate as needed.

convert image.eps -crop 1002x1000+0+0 +repage image.jpg

the +repage would be needed to remove the virtual canvas, but jpg does not support it, so you can leave it off. But it would be needed for PNG or GIF, for example.

Re: Extra pixel while converting

Posted: 2013-08-04T23:46:27-07:00
by deepeshsp
Thanks for the reply. that worked well.

But I am automating this process, so I wont be able to know if I have to crop or not.

What I need is force the convert to round the input, ie, 1000.03 to 1000 and 1000.53 to 1001. Is there anyway I can do that?

Re: Extra pixel while converting

Posted: 2013-08-05T10:10:07-07:00
by fmw42
Is the Adobe size information available for external computer access? It probably comes from the dpi setting converted to pixels given some dimension in inches for the output. If you can access any of that, you can compute the size and do your own rounding in an IM variable calculation.

See what information is available from

identify -verbose yourimage.pdf

That kind of information may be there for you. Can you post either your image or the verbose information?