Sounds overall like a good plan to me.
If using luminance leads to better results, should we be doing that by default,
and only do it for each channel separately if some other flag is set
(perchan=1)?
And I'm assuming that contrast leaves any designated alpha channels untouched?
Can the contrast be a color as well as a float? For example, can you
oiiotool in.png --contrast 1.5,1.5,0.8,1 -o out.png
and would that add contrast to R and G, reduce it a bit in B, and leave the
alpha channel alone?
On Jul 23, 2012, at 11:51 PM, Stefan Stavrev wrote:
> Just a reminder, I am working on manual contrast that
> applies this formula to all pixels:
> out = (in - pivot) * contrast + pivot
>
> I propose this API: http://ideone.com/thm5e
>
> and this usage:
>
> 1. ./oiiotool in.png --contrast contrast -o out.png
> This applies the formula to all channels, and assumes
> pivot = 0.5(average of 0 and 1), which is mostly used.
>
> If you want to specify pivot then:
> ./oiiotool in.png --contrast:pivot=0.3 contrast -o out.png
>
> 2. ./oiiotool in.png --contrast:rgb=1 contrast -o out.png
> This means we have RGB image as input and the formula
> is applied to the luminance channel rather than all channels,
> which leads to better results.
>
> If we want to specify pivot then:
> ./oiiotool in.png --contrast:rgb=1:pivot=0.3 contrast -o out.png
>
> So, if the user wants to apply the contrast method to all channels
> he can use option 1). If for RGB images he wants better results,
> he can use 2). I expect pivot to be rarely changed, the default 0.5
> will be good enough for many cases.
>
>
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
[email protected]
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org