lowtechmag-solar-plugins/dither
rra 3d0a753f06 update pelican plugins as they are now used on solar.ltm 2021-01-12 13:28:53 +01:00
..
README.md initial upload 2018-09-27 13:10:22 -04:00
__init__.py initial upload 2018-09-27 13:10:22 -04:00
dither.py update pelican plugins as they are now used on solar.ltm 2021-01-12 13:28:53 +01:00

README.md

Dither plugin for Pelican

A plugin which creates dithered versions of all your images. To save on space and gain on cool.

The dithering algorithm used is Bayer Ordered dithering. The default settings convert the images to six-tone greyscale but it is possible to configure one's own color palette.

The plugin copies all images into a folder called dithers and replaces all image paths of the resulting html to show the dithered images.

dependencies & installation

depends on Pillow, hitherdither and BeautifulSoup 4

pip install Pillow bs4 git+https://www.github.com/hbldh/hitherdither

Set it up like other plugins: make sure to set PLUGIN_PATH and add thumbnailer to the PLUGINS list.

configuration

  • IMAGE_PATH Path where all images are located, defaults to images
  • DITHER_DIR The subdirectory where all dithered versions of your images are stored, defaults to dithers
  • THRESHOLD this essentially sets the contrast on the final image. Defaults to [96, 96, 96], make sure it is a list of three numbers ranging from 0-255.
  • RESIZE_OUTPUT Whether the dithered images should be resized. Defaults to True
  • MAX_SIZE Max size to resize to. Uses the largest value (width or height) and preserves aspect ratio. Defaults to (800,800)
  • DITHER_PALETTE What palette to use for dithering. Needs a list of RGB tuples. Defaults to a six tone greyscale palette: [(25,25,25), (75,75,75),(125,125,125),(175,175,175),(225,225,225),(250,250,250)] See hitherdither for more info.