My task is to reduce size of scanned text document into .png with acceptable quality loss. My procedure consist of those steps: Raw images are scanned in tif format and processed by ScanTailor (automatic tool for cutting double pages, fixing a tilt, cropping and converting to grayscale).
Batch proccesing by ImageMagick:
convert in.png -resize 2000X2000 -sigmoidal-contrast 12,60% -colors 8 out.png
optipng in.png -o7 out.png
The problem is that option -colors 8 has worse size reducement then GIMP's Indexed color mode with "Optimal palette" with max 8 colors.
I also tried to
convert in.png -dither FloydSteinberg -remap colors.png out.png
but a result was nearly the same as -colors option.
What does GIMP do in another way that it exports smaller png? Is there another good practice how to archive scanned text images and make them smaller in png with acceptable quality loss?
Here are images before optipng created with different methods.