Skip to content

0.3.10 "From Blue To Violet"

Compare
Choose a tag to compare
@tommyettinger tommyettinger released this 04 Oct 02:42
· 275 commits to master since this release

This release has several significant changes! There's a new dither algorithm (ROBERTS), simplified and improved GRADIENT_NOISE, a change to the default palette (back to DawnBringer's Aurora), and a change to how the threshold is calculated when you call PaletteReducer.analyze(). The last two of these can change what existing code will produce, so be advised that you may need to make some changes.

The palette change affects PaletteReducer objects created with no palette, with an invalid palette, or that had setDefaultPalette() called on them; Aurora was used in the earliest versions of the library, but I tried to increase yellow coverage by switching to a randomly distributed palette, Haltonic. Unfortunately, Haltonic was probably too random, and couldn't handle smooth gradients well at all because it jumped around between hues as it went up or down in lightness. You can still use Haltonic as a palette by passing it to PaletteReducer's constructor or to PaletteReducer.exact(), and it is available as a constant array in PaletteReducer.

The threshold change could be trickier, and you might need to raise or lower the threshold from the default 100 when you call analyze(). The threshold is automatically adjusted based on the limit for how many colors the palette can use; to try to maximize color coverage, PaletteReducer lowers the threshold to allow more colors in when the limit is larger. The threshold is hard to evaluate for all images equally, and it's a good idea to try and see which of 50, 100, and 200 looks best to you when the palette matters.

Hopefully this release will result in some nicer looking palette reductions and animations. Good luck.

Oh yeah, and happy birthday, Violeta!