Convert eps to png and resize too heavy

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ztrange

Convert eps to png and resize too heavy

Post 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.
ztrange

Re: Convert eps to png and resize too heavy

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Convert eps to png and resize too heavy

Post by anthony »

Either use -colors to quantize (color reduce) the result, or preserve the existing colors by using -scale instead of -resize or -thumbnail.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
ztrange

Re: Convert eps to png and resize too heavy

Post 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
Post Reply