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.
Extra pixel while converting
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Extra pixel while converting
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.
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
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?
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?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Extra pixel while converting
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?
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?