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

Add color model for 32b float #158

Open
Cenobytes opened this issue Feb 2, 2023 · 2 comments
Open

Add color model for 32b float #158

Cenobytes opened this issue Feb 2, 2023 · 2 comments

Comments

@Cenobytes
Copy link

FFmpeg is using internally AV_PIX_FMT_GBRPF32 and AV_PIX_FMT_GBRAPF32 to handle 32b floating point pixel format.
It should be interesting for high quality filtering to handle the second one, with a name like F0R_COLOR_MODEL_BGRAF32 = 3.
Many professional tools like DaVinci Resolv use this kind of encoding internally.
Moreover, the structure f0r_param_color_t is already using 32b float in [0, 1] range.
The patches for both ffmpeg and frei0r is quite easy and less than 10 lines of code, unless I missed something...

@jaromil
Copy link
Member

jaromil commented Feb 26, 2023

is there any filter we could port or implement, to have at least one working reference that uses this new colorspace?

@Cenobytes
Copy link
Author

Cenobytes commented Mar 12, 2023

There are many advantages of using floats instead of 8b integers (and even 16b fixed point)

  • processing on shadows with far less artefacts due to inappropriate quantization
  • process that use many operations in sequence which have bad distributive property (where in old days we used algorithms like sigma-delta to propagate computation roundings)
  • floats allows to reduce the clamping constraints of values above max on intermediate images, so involves filter chains, not really a single filter

I didn't find a filter in frei0r focused on shadows processing (like in Gimp in Shadows-Highlights tool), but the levels filter should be an easy one to port. Unfortunately as it is linear it won't have much benefits. The curve should be more interesting but it is far more complex.

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

No branches or pull requests

2 participants