49
votes

I have a .eps file that I can look at in Photoshop, and it has a very high resolution, sharp edges, etc. at even larger than 1024x1024.

With ImageMagick I want to convert this .eps to a 1024x1024 .jpg with very high resolution.

However, with the following command, the image is very blurry:

convert -resize "1024x1024" -colorspace RGB -flatten test.eps test.jpg 

What ImageMagick parameters do I have to use so that the resulting .jpg is 1024x1024 and a high quality, sharp image?

here's some XMP data we found, perhaps what is causing it to not be resized with -size:

enter image description here

2
since JPG uses the DCT-transformation its intended for natural-images, i.e. photos. It is not suited for images with sharp edges. Use png-instead. Just a thought...Fredrik Pihl
the command convert -resize "1024x1024" -colorspace RGB -flatten test.eps test.png still produces a blurry .png file, I need to increase the dpi I would think but can't get the right parameter settingEdward Tanguay
try using -filter as described here to change the resize method used to something more appropriateFredrik Pihl
couldn't find any filter setting that would work, e.g. convert -resize "1024x1024" -colorspace RGB -flatten -define filter:blur=.4 test.eps test.jpg doesn't make it any sharper but turns it into little squaresEdward Tanguay
well, blur with an radius of .4 is perhaps not the best filter suitable for resize :-)Fredrik Pihl

2 Answers

90
votes

For vector graphics, ImageMagick has both a render resolution and an output size that are independent of each other.

Try something like

convert -density 300 image.eps -resize 1024x1024 image.jpg

Which will render your eps at 300dpi. If 300 * width > 1024, then it will be sharp. If you render it too high though, you waste a lot of memory drawing a really high-res graphic only to down sample it again. I don't currently know of a good way to render it at the "right" resolution in one IM command.

The order of the arguments matters! The -density X argument needs to go before image.eps because you want to affect the resolution that the input file is rendered at.

This is not super obvious in the manpage for convert, but is hinted at:

SYNOPSIS

convert [input-option] input-file [output-option] output-file

1
votes

Maybe you should try it with -quality 100 -size "1024x1024", because resize often gives results that are ugly to view.