Lo-fi image dithering
Go to file
Sloom Sloum Sluom IV 46f87e1a19 Merge pull request 'Use env to find the python3 executable for extra portability.' (#1) from kvothe/lid:master into master
Awesome! Glad to hear you are digging it. I had fun working on this one.

Your change is of course the right one. I usually do use env, not sure why I didnt for this, lol. Thanks for the pull! Merging in now.
2020-09-06 04:03:52 +00:00
.gitignore Added a threshold and all mode. Reworked the application into a class and reused relevant code for each dithering method. 2019-06-05 21:19:17 -07:00
README.md Added random dither and updated readme 2019-06-09 13:15:00 -07:00
lid Use env to find the python3 executable for extra portability. 2020-09-05 16:13:20 -04:00



lo-fi image dithering

Lid performs fairly basic 1 bit image dithering. It converts an input image to grayscale and then dithers that image. It then optimizes the output and saves the file. The result is a reduced filesize, simple image, great for small page sizes.


  • Python3.x (built and tested with 3.6)
  • PIL (python3 -m pip install Pillow)


lid [option]... [source path] [output name]

-f = output format, defaults to the recommended setting: png
-m = mode, available: o4, o9, e, t, r, a. default: o4.
-q = quality (0 - 100), defaults to 90, only affects jpeg/jpg
-t = threshold (0 - 255), defaults to image average level. only affects dither mode 't'

source path = a path to an image file you want to dither
output name = the name of the file you would like to output, do not include file extension

Lid works best outputting png files from any input. You will get the smallest file with the best quality this way.



This is the lowest quality mode. It produces the smallest file, but at the cost of most detail.


Random dithering produces a fairly large file (comparable to error diffusion), without moving much closer to photographic quality. However, it does provide an interesting effect.


This mode is a noticable difference from the stark two tone appearance of threashold mode. The appearance 'gray' areas make for a slightly more photographic image.


This mode produces medium quality dithering, it is still a very noticeable effect but not as harsh as o4. It is a nine level ordered dither.


This is the highest quality mode. It uses an error diffusion dither. The file size will be the largest of the bunch, but should still be a good reduction from a regular full color photograph.


The a, or all, mode is a quick flag to say that you want an image put out in all of the modes. The mode flag value for each will be appended to the filename.


Public domain. Use it, improve it, share it!