libvips / libvips

A fast image processing library with low memory needs.
https://libvips.github.io/libvips/
GNU Lesser General Public License v2.1
9.74k stars 677 forks source link

Possibly add some dithering algorithms #278

Closed dg1727 closed 3 years ago

dg1727 commented 9 years ago

Suggestion: Add dithering algorithms as given on http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/ (obviously excepting the "false Floyd-Steinberg" one and, as far as I am concerned, the two "ordered dither" ones as well).

This would help in converting greyscale to 1-bit bitmaps, and as noted at the beginning of the referenced article, also has applications in reducing images to any arbitrary bit depth (someone may find that a compressed image with 64 or 128 or however-many colours has the right storage size or download time for something [s]he needs).

This proposal is for after the VIPS 8.0 release.

jcupitt commented 8 years ago

There's a vips plugin here which does a very simple 4x4 ordered dither:

https://github.com/jcupitt/vips-dither

It's apparently useful for hiding banding on 16bpp displays.

jcupitt commented 4 years ago

8.10 will automatically dither low bit depth PNG images. There's a dither parameter to prevent this.