Skip to content

0.4.1 "Wren Free"

Compare
Choose a tag to compare
@tommyettinger tommyettinger released this 17 Sep 06:59
· 143 commits to master since this release

This release mostly adds the new WREN dither algorithm, a mix of error-diffusion, the R2 sequence pattern, and blue noise that would make Dr. Frankenstein cry tears of joy. WREN is almost as good at preserving hue as the closely-related WOVEN, but is much better at avoiding "flatness" where there should be a gradient of shading. Like WOVEN, it works especially well with small, mixed-color palettes like the DB8 palette in the README.md previews, and still works great with larger palettes. WREN is the current default; it just in general does better than NEUE did on more input images. NEUE may still do better on black-and-white-only palettes, or some other situations like that, because it doesn't treat the 3 RGB channels separately.

The other change in here is not an API change, but still may be noticeable: The lightness curve, which determines how a given float between 0.0 and 1.0 representing lightness gets converted to actual pixel colors, has been slightly adjusted and should be much closer to how it (probably) should be. It's also much easier to think about and potentially port to shader code, because it no longer uses as many conditionals or other code that changes the curve in confusing ways -- actually, the two functions are now equivalent to Math.pow(3.0/2.0) and Math.pow(2.0/3.0).

PaletteReducer.colorsFrom(Pixmap) is also a possibly-convenient new feature that gets the most frequently-encountered colors in a Pixmap (typically up to 256) and returns them as an array of RGBA8888 ints (like PaletteReducer.exact(int[]) can use. This may be handy for loading a palette from a user-provided image.

Considering I had a fever for some of the development here, I'm pretty happy with it! Enjoy!