photopea / UPNG.js

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

Ghost pixels on animated png #40

Closed jeanbmar closed 4 years ago

jeanbmar commented 4 years ago

Hi,

I've noticed an issue when encoding an APNG file with default params: test I can't pinpoint what's wrong exactly, but I have a feeling it's related to blending. Replacing the regular encode call with the following code fixed the issue (huge thanks for exposing the internal methods btw):

var nimg = UPNG.encode.compress(bufs, w, h, ps, [true, false, false, 0, false]);
UPNG.encode.compressPNG(nimg, -1);
UPNG.encode._main(nimg, w, h, dels);

test-ok

photopea commented 4 years ago

Hi, can you give me your animation in GIF or (correct) APNG format, so that I can try it myself?

jeanbmar commented 4 years ago

Edited my original post with the Ok APNG

photopea commented 4 years ago

Hi, it is so strange. I opened your APNG in www.Photopea.com and tried to export it as PNG. The result seems do be correct (without any ghost pixels).

I updated UPNG.js with the latest version from my computer. Can you try it again?

photopea commented 4 years ago

I will have to close it because of lack of details.