MonoS / SupMover

SupMover - Shift timings and Screen Area of PGS/Sup subtitle
GNU Affero General Public License v3.0
40 stars 4 forks source link

Tonemap to a specific color code #21

Open vevv opened 1 month ago

vevv commented 1 month ago

It would be nice to be able to specify a target hex color code like in subtitle_tonemap, should be pretty easy to add (just split to R/G/B and calculate, e.g. #a7a7a7 -> 167/167/167 -> (167/255) * 100 -> 65%).

edit: It seems you have to use the main color's code instead of 255 (e.g. 204) works, and it's the same way Subtitle Edit's percentage works.

I guess you would need to find the brightest color present in the subtitles, use that as reference, and calculate a percentage off of that to change other colors.

MonoS commented 1 month ago

Hi @vevv, well, in reality is not that easy, subtitle_tonemap works on RGB while my tool works on the YUV palettes and to map quietvoid's functionality to mine i'd need to implement conversion and handling of YUV color or RGB color for the input parameters taking into account also BT709 or BT470BG matrix when doing the conversion, I'll think about it.

vevv commented 1 month ago

Wait, YUV? I thought the entire format is just RGB images, which is why HDR subs are just darker.

In any case, if you could get this implemented, it would be very much appreciated!