-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fully opaque images with alpha channel are rendered slightly transparent when zoomed out #747
Comments
This is a side effect of anti-aliasing. If you use |
You're right, it does also happen for images without an alpha channel. I didn't realize because the effect isn't as large—I guess there's a compounding effect with the addition of an alpha channel. It's still somewhat surprising to me that artifacts would occur in the case where every pixel is the same, though. This is the easiest case for an anti-aliasing filter—all frequencies are 0. Intuitively, it should be possible to handle this without adding a DC offset. I haven't looked through the code, but I have a small suspicion that somewhere in the anti-aliasing algorithm there are some floating-point values being truncated vs. rounded to the nearest integer, or an off-by-one error, or something similar. |
If I am not mistaken anti-aliasing is handled by imlib_context_set_anti_alias() from imlib2. I think https://git.enlightenment.org/old/legacy-imlib2 is the repo for it. That might be the correct place for this bug report. |
PNG images that are fully opaque but have an alpha channel appear slightly transparent when the zoom is less than 100%, allowing the checkered background to be faintly visible.
Steps to reproduce:
Create an opaque white image with an alpha channel:
Run
feh --zoom 50% white.png
.A faint checkerboard pattern might be visible behind the image depending on your display settings. For confirmation, use a color picker to see that the colors in the image alternate between
#fdfdfd
and#fefefe
.To see the effect more clearly, take a screenshot of feh and adjust the levels:
Screenshots:
Screenshot of
feh --zoom 50% white.png
:With levels adjusted:
In case it's useful, here's the copy of white.png I used.
Program version:
The text was updated successfully, but these errors were encountered: