On Sun, Jul 22, 2012 at 7:45 AM, Stefan Stavrev <[email protected]> wrote:
> For both grayscale and RGB images, adjusting brightness
> means adding/subtracting a constant from all pixels.
>
> I am not sure if I should add such function as I said in my proposal.
> The API user can do it himself, but maybe I should do it for
> the sake of the command line user?

The command line user can already achieve this, though in a somewhat clumsy
way.  For example:

oiiotool A.png --pattern constant=0.1,0.1,0.1 640x480 3 --add -o B.png

will add 0.1 to each channel of a three channel image A.

A lot of the clumsiness comes from having to know the size of A (640x480, 3
channel), just to construct a constant image of the same size.  It would be
nice to have a way of dealing with such "scalar" quantities in a generic way
in oiiotool.  One possibility would be to declare that 1x1 images act as
scalars, and broadcast that single pixel across every pixel of the other
image in a pointwise manner.  Then we could write something like

oiiotool A.png --pattern constant=0.1,0.1,0.1 1x1 3 --add -o B.png

Question for the list: Is this a crazy idea?  Would it have other undesired
side effects?  It would surely introduce a few more special cases into
the implementation of each binary operation...

~Chris
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to