cdgriffith / FastFlix

FastFlix is a free GUI for H.264, HEVC and AV1 hardware and software encoding!
https://fastflix.org/
MIT License
1.13k stars 55 forks source link

Add LUT support #391

Open MarcoRavich opened 1 year ago

MarcoRavich commented 1 year ago

Thanks to @RxLaboratory's DuME we discovered @AcademySoftwareFoundation's OCIO framework that seems very interesting (and widely adopted) for color management/manipulation.

Hope that inpires !

cdgriffith commented 1 year ago

This seems like the ask might be to just apply a lut filter via ffmpeg with https://ffmpeg.org/ffmpeg-filters.html#lut3d-1 or similar?

Seems like that is how it works with photoshop https://opencolorio.readthedocs.io/en/latest/guides/using_ocio/using_ocio.html#photoshop

Not sure what the ask really is from FastFlix's perspective? An encoder might be able to interface with this, but FastFlix could just pass through information.

MarcoRavich commented 1 year ago

Well, we honestly don't know how @Nico-Duduf exploited OpenColorIO exactly, anyway it would be very interesting to have a "LUT manager" option in the FF GUI too.

Here's the Apply a LUT by DuME:

...and they integrated Convert LUTs too:

Hope that inspires !

Nico-Duduf commented 1 year ago

Hi!

the "Apply LUT" uses the ffmpeg filter (with some tricks to convert the color profile with another filter when the user selects an input profile which is different from the actual input, although it's not recommended)

The OCIO LUT Baker & LUT Converter uses a tool provided by OCIO, it's just a GUI for the existing OCIO tool actually, nothing fancy ;)

MarcoRavich commented 6 months ago

the "Apply LUT" uses the ffmpeg filter (with some tricks to convert the color profile with another filter when the user selects an input profile which is different from the actual input, although it's not recommended)

Do you mean lut3d filter @Nico-Duduf ?

If so, can you suggest some guides/resources to better understand and eventually implement its use ?

Here's some - dunno if useful or not - that I found:

Nico-Duduf commented 6 months ago

IIRC there may be two different filters, lut1d and lut3d for these two types of LUTs. They're pretty straightforward to use, but you have to make sure they're applied to images using the right color space. You may need to apply multiple LUTs (or gamma correction, etc) to go from one space to the other.

Specifically for OCIO, you can use the command line ociobakelut tool (it's available with OCIO) to generate any LUT you may need and apply it with FFmpeg's lut3d filter, that's what DuME does for now, until OCIO is properly implemented in DuME.