photopea / UPNG.js

Fast and advanced PNG (APNG) decoder and encoder (lossy / lossless)
MIT License
2.1k stars 259 forks source link

How do I encode my ImageData 1-to-1, keeping #12345600 color (RGBA) as it is, not dropping to #00000000? #73

Open kotoOo opened 2 years ago

kotoOo commented 2 years ago

The manual states that UPNG.encodeLL ain't running any optimizations, but looks like it still performs alpha premultification, doesn't it?

photopea commented 2 years ago

It is a bad practice to store useful RGB data into pixels, which have a transparency 0.

But UPNG.encodeLL() should keep the original data, without modifying pixels. Are you sure the bug is not in your code?