Page 1 of 1

Preserving image quality when resizing

Posted: 2007-08-29T04:52:56-07:00
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.

Re: Preserving image quality when resizing

Posted: 2007-08-29T07:05:25-07:00
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.