This is a follow up to and old question from StackOverflow scale and reduce colors to reduce file size of scan

Unfortunately convert of imagemagick is too slow (Sometimes our system receives several images per minute. Up to now there is only one server which converts the files. If this takes too long, the customer has to wait).

Here the old question again, but this time on softwarerecs, since I search a tool and not programming hints.


I need to reduce the file size of a color scan.

Up to now I think the following steps should be made:

  • selective blur (or similar) to reduce noise
  • scale to ~120dpi
  • reduce colors

Up to now we use convert (imagemagick) and net-ppm tools.

The scans are invoices, not photos.

Any hints appreciated.

Sample data:

Required Features

  • The human eye should not detect a big difference when looking at the image at whole on a standard monitor.
  • Color reducing should be done. But not to black/white. I guess at least 8 colors are needed.
  • Open source software preferred, but not a "must".
  • Faster than convert of imagemagick. But don't take this too serious. Small file size is the major topic.
  • Must run on linux servers in batch mode (no GUI). Don't care for windows, mac or android.
  • How slow is "too slow" to convert one image? Also, have you tried acquiring the image from the scanner in black and white to reduce the colors rather than using image processing?
    – Russ L
    Dec 1 '16 at 21:01
  • @RussL "How slow is "too slow" to convert one image?" this depends on the hardware and on the image. Please don't take this too serious. And: I want colors, not black and white! I want to reduce the amount of colors, since reduces the file size a lot.
    – guettli
    Dec 2 '16 at 9:20
  • I see, so you're more looking to go from 24-bit to 8-bit. I'm not big into Linux, but GIMP may work. I also found this list you might find helpful: tecmint.com/best-image-photo-editors-for-linux
    – Russ L
    Dec 2 '16 at 20:51
  • @RussL thank you for your link. In my case batch processing is important. I guess you can do this with gimp, but I have the feeling that this is the wrong direction.
    – guettli
    Dec 5 '16 at 11:06
  • What server is this? Raspberry or even smaller? Images per minute should not be an issue. Please define your hardware environment. Jan 9 '17 at 15:31

You can use jpeg instead of png.

Use convert on the command-line (from ImageMagick) and jpegoptim:

convert example.png example.jpg; jpegoptim -S100k example.jpg

The resulting file is about 100k.

Readable, but not perfect.

Here is the result: http://www.thomas-guettler.de/tbz/example_jpegoptim_100k.jpg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.