SuRGeoNix/Flyleaf

Renderer: Level/Gamma Support

Opened this issue · 4 comments

Black--gamma--White

like photoshop--Level:
level

Black (0 min , 127 max)
The default value for gamma is 2.2, (range 1.0 min 5.0 max)
White(128 min , 255 max)

Hi @Charltsing, not sure how I should properly include this in the pixel shader, here:-

https://github.com/SuRGeoNix/Flyleaf/blob/master/FlyleafLib/MediaFramework/MediaRenderer/ShaderCompiler.cs#L366

I tried this color.rgb = pow(color.rgb, gamma); and not even sure for the right allowed values it should have. Give it a try and let me know or create a PR so I can include this.

it is a level code:
https://github.com/ImageMagick/ImageMagick/blob/bacef9eb7565b34b1c4c9a8fa5ceccbc4fc5b6b2/MagickCore/enhance.c#L2913

MagickExport MagickBooleanType LevelImage(Image *image,const double black_point,
const double white_point,const double gamma,ExceptionInfo *exception)

@Charltsing This should be implemented with the pixel shader in GPU and no in RAM for performance. It will require more research and I'm afraid I will not be adding any new features in v3 as I'm trying to focus in the new major v4.

Thanks for your reply.