Preserving image quality when resizing

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
brendan

Preserving image quality when resizing

Post by brendan »

I am resizing png's, trying to get a negligible quality loss and preserve the filesize. The images have 67 colours, including black and white and a 64 element colormap with a linear colour distribuition in RGB space from red to blue (jet). The images are contour maps and as such have very smooth transitions in colour over most of the image.

When I try the following:

Code: Select all

convert -trim -border 20 -bordercolor white -resize 60%  -depth 8 -colors 67 test.png test2.png
I get an unacceptable amount of dithering. My first question is how to a fix the dithering. My second question is how do I force the resized pngs to use the exact same colourmap as the original?

Thanks.
brendan

Re: Preserving image quality when resizing

Post by brendan »

Never mind. I got it. When reducing use -filter box the smooth the image, but also increase number of colours i.e.-colours 128 to prevent blocky colour truncation.

Found the answer in the excellent usage guide here.
Post Reply