"libwebp" decoding seems to incorrectly handle Alpha cloaked parts #51
Replies: 3 comments 9 replies
-
Thx for reporting. Can you please open an official bug at [ https://g-issues.webmproject.org/issues/new?component=1615215 ]? For the cropped version giving different results, well, that can happen unfortunately. |
Beta Was this translation helpful? Give feedback.
-
It's primarily about decoding: Probably default to using more regular handling on decoding such? Note: |
Beta Was this translation helpful? Give feedback.
-
@jzern, @vrabaud |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Which may lead to "-noalpha" alike (discarding Alpha outright) decoding:
Unexpectedly include those pixels should be fully cloaked by Alpha (that originally invisible).
E.g.
[ Help: https://ffmpeg.org/ffmpeg-filters.html#pad etc. ]
ffmpeg -y -v trace -hide_banner -nostdin -nostats -i "dazzle.webp" -lavfi "crop=oh:(( iw - 12 )),pad=(( iw + 12 )):(( ih + 12 )):-1:-1:#00000000,split=5[-][-][-][-]; [0][-]ssim,nullsink; [0][-]psnr,nullsink" -lossless 1 -q 100 -compression_level 6 "dazzle-re.webp" -map "[-]" "dazzle.png" -map "[-]" -pix_fmt rgb24 "dazzle-a.png"
# ^ Reported SSIM, PSNR differed meanwhile. "dazzle.png" maintains the same data; "dazzle-a.png" except Alpha.
ffmpeg -hide_banner -nostdin -i "dazzle.webp" -i "dazzle-re.webp" -lavfi "ssim; [0][1]psnr" -f null -
# ^ "dazzle.webp", "dazzle-re.webp" shall be identical files.
cwebp14 -mt -z 9 "dazzle.webp" -o "dazzle.x.webp"
cwebp -mt -z 9 -noalpha "dazzle.x.webp" -o "dazzle-a.webp"
# ^ WebP 1.4.0 vs. 1.5.0 gave different image. (differed the border)
"dazzle.webp" is fundamentally 500x500 opaque image, padded with 6px full-transparency each border.
Bizarre thing is that the cropped version (without padding), would instead take more bytes to store..?
cwebp -mt -z 9 -crop 6 6 500 500 "dazzle.webp" -o "dazzle-.webp"
(174,816 B vs. 173,096 B)
Plus a "-mt" anomaly:
https://github.com/MasterInQuestion/talk/discussions/52
@jzern, @vrabaud?
Beta Was this translation helpful? Give feedback.
All reactions