a problem with resizing a eps file

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
lowkey
Posts: 3
Joined: 2017-12-04T10:41:55-07:00
Authentication code: 1152

a problem with resizing a eps file

Post by lowkey » 2017-12-22T20:54:09-07:00

Hello all,
I want to resize a .eps file.

IM Command(Mac High Sierra 10.13.1, ImageMagick 7.0.7-13 Q16):

Code: Select all

convert EPS:test.eps -resize 800x800 test2.eps
I am able to resize the image and generate a .eps file, but it's different from the old one.

My input image:
https://github.com/l-dandelion/images/b ... S/test.eps

Output image after applying the IM command:<br/>
https://github.com/l-dandelion/images/b ... /test2.eps

But when I convert it to a .jpg or .png file, it works.

Code: Select all

convert EPS:test.eps -resize 800x800 test3.jpg

User avatar
fmw42
Posts: 23833
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: a problem with resizing a eps file

Post by fmw42 » 2017-12-22T21:48:35-07:00

ImageMagick is a raster processor. So any vector file such as EPS will be rasterized. Imagemagick cannot re-vectorize it. So the raster file is only put into a vector shell. Thus, ImageMagick is probably not the tool you want, if you want to go from vector to vector.

See http://www.imagemagick.org/Usage/formats/#vector

The color reversal is likely due to test.eps being CMYK. So try

Code: Select all

convert -colorspace sRGB EPS:test.eps -resize 800x800 test2.eps
Red coloration differences are probably because your original contains spot colors and ImageMagick cannot handle them.

Note that pure vector images have no size. They are controlled by density when printing. What you are doing is converting the vector image into a raster image at its default density, resizing it and putting it back into a vector shell. I do not see the point of doing that with ImageMagick. You might as well just convert to JPG or GIF.

Post Reply