atanunq / viuer

Rust library for displaying images in the terminal.
MIT License
253 stars 46 forks source link

Added support for proper alpha blending, limited & updated dependencies #59

Closed virtualritz closed 3 weeks ago

virtualritz commented 1 month ago

See also the README in my branch. You may want to cherry-pick that out btw.

Before: image

After: image

virtualritz commented 1 month ago

This fixes #43, I believe.

virtualritz commented 1 month ago

Note that this alpha blending is not correct but good enough. To be correct, the colors need to be in linear color space.

This requires determining in which color space they are to start with, linearizing them in at least u16/channel, carrying out the blending and then transforming them back to gamma-corrected sRGB, the only sensible space for display in a terminal.

I figured that this is beyond the scope of the crate (for now).

But if this is merged I would open another PR that explains this limitation in the docs.

atanunq commented 3 weeks ago

Fantastic stuff, thank you @virtualritz!