Skip to content
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

Gamma correction #24

Open
toothbrush7777777 opened this issue Apr 27, 2024 · 3 comments
Open

Gamma correction #24

toothbrush7777777 opened this issue Apr 27, 2024 · 3 comments

Comments

@toothbrush7777777
Copy link
Contributor

toothbrush7777777 commented Apr 27, 2024

Should the font image values be gamma-corrected for standard displays (i.e. sRGB) instead of being linear intensities? In other words, should the values be linear_to_srgb(intensity)?

It isn't very hard to filter the values when creating the font images – this can be done with a 256-byte lookup table – and would be a lot faster than doing so when using the values to create the fonts.

The characters look better and less blurry after gamma correction for sRGB displays.

@phip1611
Copy link
Owner

Sounds correct, yes. TBH, I never thought about this.

@toothbrush7777777
Copy link
Contributor Author

toothbrush7777777 commented Apr 28, 2024

Yeah, I messed around with gamma encoding a bit when I was writing a physically-based renderer a few months ago, and gamma correction is absolutely vital for any kind of realistic render.

Gamma correction is not such a huge deal for standard GUIs, but I noticed that the font on low-PPI displays looks a lot better with gamma correction.

Shall I create a pull request for that?

@phip1611
Copy link
Owner

Shall I create a pull request for that?

Yes, I will appreciate that very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants