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
Perform gamma correction in screenshot.rs #96
Conversation
Non-gamma-corrected (current behavior, left) and gamma-corrected (PR behavor, right) screenshots, side by side: Full size (if you have a 1x screen): The one on the right looks closer to how the reMarkable physically displays the framebuffer. It's just that the PNG image had to be prepared (gamma correction) to properly look that way in an image viewer, which generally expects sRGB from PNG images. And notice how the outlines around the buttons look a lot more consistent on the gamma-corrected screenshot. |
Not sure how you'll feel about the last commit but I thought it'd be worth pushing so you can try it out. I'll probably need to revert it before this is merged :P |
It might be worth incorporating a couple LUTs like that one into libremarkable itself to provide convenience functions like, for example, |
Embedded LUT:
Not sure where the mismatch is, but it's close enough. Still faster than the original (0.679s)! |
Is this good to merge? Anything more I need to address? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it out and it works fine!
I should also consider adding this to #94 then.
* Support multiple formats and default to png * Replace BufWriter with Cursor There is no point in BufWriter here, as it operates on memory and not files. * Show encoding speed in console * Add html page to select format by default * Rename some variables to be more explicit * Include gamma correction added to screenshot in #96
Right now, screenshot.rs takes the raw rgb values and pipes them into a PNG image.
This is not sufficient; viewers generally assume that pixel data in PNGs is sRGB (unless otherwise specified, which
screenshot.rs
does not). So map it from linear RGB to sRGB. This results in graphics looking much smoother on computer monitors.