[Ffmpeg-devel] PATCH colortrunc

Martin Boehme boehme
Mon Jul 25 15:13:57 CEST 2005


Marcus Engene wrote:
> Martin Boehme wrote:
>>> An utterly silly question, would it solve Kris's problem by doing a 
>>> vhook squeezing 0-255 into 16-234 or am I on snus again?
>>
>> I guess so... but it would require programming.
>>
> Ok, I did some programming :-)

That was quick... ;-)

> * Colortrunc "truncates" the color range. If your file contains
> * colors between and including 00-0xff (ie normal 8bit) you can
> * force color 0 to be 16 .. 255 to be 234 by doing...
> *
> * ffmpeg -i infile -vhook '/path/colortrunc.so -r 16-234 -g 16-234 -b 
> 16-234' out.mov

I think you should be operating directly on the luma (Y) component... 
Take a pixel with RGB values of (0, 255, 0), i.e. bright green. The luma 
is well within limits (0.587*255=149.7), but you would be changing it to 
(16, 234, 16) -- which desaturates the colour as well. Plus, if you 
operate directly on YUV, you can save two pixel format conversions. ;-)

Martin

-- 
Martin B?hme
Inst. f. Neuro- and Bioinformatics
Ratzeburger Allee 160, D-23538 Luebeck
Phone: +49 451 500 5514
Fax:   +49 451 500 5502
boehme at inb.uni-luebeck.de





More information about the ffmpeg-devel mailing list