Page 1 of 1

Convert eps to png and resize too heavy

Posted: 2009-04-27T20:55:39-07:00
by ztrange
Hello everybody

Im using convert to transform some eps to png files and be able to present them in the browser.

Im generating 2 versions: one with some kind of actual size and the other one resized so that it fits in a 200x200 box:

convert image.eps +matte image.png

convert image.eps -resize 200x200 +matte image.png

But the odd thing is that the 200 pixel image is way heavier than the big one. So, I played with the density option but I couldn't see any change in the output weight.

So, I'm wondering if there are some recommended options to make the outputs as light as possible.

Also, if you could give me some recommended options to make then look as alike as the original as possible.

Thanks in advance.

Re: Convert eps to png and resize too heavy

Posted: 2009-04-27T21:36:39-07:00
by ztrange
Ok I found that the problem is the number of colors used in the different pngs. While the big one has got 3 different colors: black, white and one gray; the thumbnail genrerates a lot of hray tones to be able to make the interpolation.

Well, I think, now the question is: How con I force the thumbnail to use less colors?

Re: Convert eps to png and resize too heavy

Posted: 2009-04-27T21:48:15-07:00
by anthony
Either use -colors to quantize (color reduce) the result, or preserve the existing colors by using -scale instead of -resize or -thumbnail.

Re: Convert eps to png and resize too heavy

Posted: 2009-04-27T22:04:17-07:00
by ztrange
Thanks for your help, I've already tried the scale option and the result is lighter than the previous results with resize (from 16 kb to 6 kb) but is not still smaller than the direct convert (3.4kb)

Anyway, I am now reading this:
http://www.imagemagick.org/Usage/resize/

That tells everything about resizing or scaling.

Thanks for your help