treeform / flippy

Flippy is a simple 2d image and drawing library.
MIT License
59 stars 9 forks source link

Incorrect color after minifying image #2

Closed benjif closed 5 years ago

benjif commented 5 years ago
var img = newImage(500, 500, 4)

img.fill(rgba(255, 255, 255, 255))
img = img.minify(2)

img.save("out.png")

In the PNG file exported above, the background color is #FCFCFC (252, 252, 252).

treeform commented 5 years ago

This is interesting. This is some sort of integer precision issue. I'll take a look.

treeform commented 5 years ago

Fixed: https://github.com/treeform/flippy/blob/master/src/flippy.nim#L359

Thank you for reporting this!