Open nywles opened 1 year ago
This is weird. Perhaps from_rgba_unmultiplied
needs to do the multiplication in gamma space.
If I replace the let a_lin = linear_f32_from_linear_u8(a);
with let a_lin = linear_f32_from_gamma_u8(a);
in from_rgba_unmultiplied
the results are definitely closer. It looks alright but it's not the same as it was. I don't mind since this looks fine, I'm just not sure if this is the right thing to do and doesn't break anything else. Any pointers what I can check to make sure?
egui 0.19: Slightly brighter and less contrast
egui master with the gamma space alpha:
Describe the bug Alpha blending of images seems to have become additive since egui 0.20. I have tested manual Glow integration as well as eframe 0.20 and the result is the same, painting images with an alpha channel only lightens the image. I've tried lowering the alpha of the image using the
.tint()
to see if i can compensate but the effect stays.To Reproduce A minimal example based on eframe, runs on 0.19 and 0.20 with visual difference.
Expected behavior I expect the images to be alpha blended in the way 0.19 did it, this is also how image editors and html blend them.
Screenshots Version 0.19: (Sharp line around boxes with a faint flow)
Version 0.20: (Thick line around boxes)
Background image: Alpha blended overlay:
Desktop (please complete the following information):