Hacker News new | past | comments | ask | show | jobs | submit login

I haven't really tried it yet but I wonder if you might get ugly artifacts if the alpha channel is lossy. Maybe it has to be exact.



You'd probably be OK as long as the alpha extremes (0 and 255) were lossless; everything in between could probably cope with being slightly off, especially if you could control the quality of alpha and YUV separately, and the YUV quality was (somewhat) weighted by alpha, with a 1 pixel "border" into transparent areas to support interpolation when scaling. Lossless alpha and lossy YUV is already a major improvement over the status quo, however.


In a lossy WebP file with alpha, RGB is lossy but the alpha channel itself is lossless.


Artifacts in the alpha channel are surprisingly subtle. Well, it makes sense if you think about it: The opacity is low, which makes those little details very hard to see.

A gray-scale JPEG with medium quality (even if it was written by a somewhat crude encoder) will look perfect if used as alpha channel in the vast majority of cases.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: