Dither Versions Save

A fast, correct image dithering library in Go.

v2.4.0

4 months ago

Exactly one year after the previous release of this library, here's another. This significantly reduces memory usage for error diffusion dithering, as well as making it faster.

If you'd like to support the development of this library, as well as my other projects, you can sponsor me through Ko-Fi or Github Sponsors.

Changelog

Copied from CHANGELOG.md

Changed

  • Increased error diffusion dithering speed by ~50%
  • Reduced error diffusion dithering memory usage by ~70% (#13)

Fixed

  • Docs: the input does still need to be converted to grayscale for grayscale palettes, actually (#7)

v2.3.0

1 year ago

This is release is exciting, as it fixes some long standing nagging issues with the library. Now all images should be dithered correctly and producing the mathematically best output, especially compared to existing libraries. From a correctness standpoint, I think it is likely this library is complete (for the sRGB colorspace).

Note the dithered output of color images will be different in this release for most palettes. It will be improved, but it will be different. I do not consider this a breaking change.

If you'd like to support the development of this library, as well as my other projects, you can sponsor me through Ko-Fi or Github Sponsors.

Changelog

Copied from CHANGELOG.md

Changed

  • When comparing colors, each channel is weighted according to human luminance perception (didder#14)

Fixed

  • Corrected Burkes matrix (#10)
  • Palette order no longer affects output (#9)
  • Grayscale palettes don't require the input image be converted to grayscale beforehand (#7) (incorrect, see #7)

v2.2.0

2 years ago

This release supports images with transparency. See #8 and the new README section for more.

If you'd like to support the development of this library, as well as my other projects, you can sponsor me through Ko-Fi or Github Sponsors.

Changelog

Copied from CHANGELOG.md

Added

  • Support for images with transparency (#8)

v2.1.1

2 years ago

This release contains no code changes. It just contains an update to the Bayer documentation. A release was made so this update appears on pkg.go.dev.

Changelog

Copied from CHANGELOG.md

Changed

  • Update Bayer strength recommendations for color images

v2.1.0

2 years ago

This release simplifies usage of .Dither, and makes some important bug fixes around palette usage. These improvements came about because of my work on a CLI tool for this library, didder, so check that out!

If you'd like to support the development of this library, as well as my other projects, you can sponsor me through Ko-Fi or Github Sponsors.

Changelog

Copied from CHANGELOG.md

Added

  • JSON tags for OrdereredDitherMatrix

Changed

  • Dither never returns nil, making code simpler

Fixed

  • Bug where paletted images would never be detected as needing to be copied in Dither
  • Palette is actually fully copied when needed, before the colors were shared with passed slice
    • NewDitherer
    • GetColorPalette
    • DitherPaletted and DitherPalettedConfig
    • GetColorModel

v2.0.0

3 years ago

This release is mainly for some accuracy fixes, in linearization and rounding. Unfortunately it requires a breaking change, since uint16 is used for linear RGB values instead of uint8. This is the only breaking change. Please start using v2 over v1.

If you'd like to support the development of this library, as well as my other projects, you can sponsor me through Ko-Fi or Github Sponsors.

Changelog

Copied from CHANGELOG.md

Added

  • Added ErrorDiffusionStrength to set the strength of error diffusion dithering (#4)
  • RoundClamp function for making your own PixelMappers that round correctly

Changed

  • All linear RGB values are represented using uint16 instead of uint8 now, because 8-bits is not enough to accurately hold a linearized value. This is a breaking change, hence the new major version.

Fixed

  • Rounding is no longer biased, because ties are rounded to the nearest even number

v1.0.0

3 years ago

Initial release of the library, with ordered dithering and error diffusion dithering, but no special kinds of dithering. All tests pass and everything seems to work ok. Have fun!

If you'd like to support the development of this library, as well as my other projects, you can sponsor me through Ko-Fi or Github Sponsors.