|
Boost : |
Subject: Re: [boost] [GIL] color convert and color tranfer characteristics
From: Christian Henning (chhenning_at_[hidden])
Date: 2010-08-05 13:47:35
Hi Fabien, good conversations! Been a while I was thinking about gil so much.
> I have a problem with the distinction between colorspaces and color characteristics.
> I'm writing a basic transfer characteristics between lin, log, sRGB, rec601, rec709...
Interesting! I would be interested in those implementation for the
toolbox extension. Let me know if you're interested submitting. I can
help out when needed.
>
> I'm writing something like I talked for colorspaces, in the mail about "color_correct":
> * a specialization between each color characteristic and lin
> * a generic conversion to a templated type using an intermediate lin conversion
>
>
> I have two problems:
> 1) I have written a per channel functor, which seems to be the right way.
> But I don't know how to not apply it on the alpha channel if there is an alpha channel... without loosing performances because my common usage is rgba :).
I'm not sure I follow here. Small code sample possible?
>
> 2) I don't know how we can connect this with color_convert, because if we want to make a conversion from RGB to gray,
> we have to assume that RGB is linear (?) and we need to precise if we want a rec709 or rec601 luminosity...
>
> GIL code use an approximation of Rec601 to compute the luminance.
> Y' = 0.299 R' + 0.587 G' + 0.114 B' (Rec. 601 coefficients)
> Y' = 0.2126 R' + 0.7152 G' + 0.0722 B' (Rec. 709 coefficients)
Right now color_convert doesn't supply passing the rgb_to_luminance
algorithm. But I 'm not sure if that's needed for your case. When you
use the algorithm copy_and_convert_pixels algorithm you pass as the
third parameter the color converter. In your case just define your own
color converter.
Regards,
Christian
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk