Flyleaf icon indicating copy to clipboard operation
Flyleaf copied to clipboard

Renderer: Level/Gamma Support

Open Charltsing opened this issue 1 year ago • 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)

Charltsing avatar Apr 17 '24 15:04 Charltsing

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.

SuRGeoNix avatar May 05 '24 07:05 SuRGeoNix

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 avatar May 05 '24 10:05 Charltsing

@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.

SuRGeoNix avatar May 06 '24 08:05 SuRGeoNix

Thanks for your reply.

Charltsing avatar May 06 '24 14:05 Charltsing