After thinking about this a little, I think inverted values using 1.0-x will be fine for channel vals > 1.0 or < 0.0 and they should not be 'symmetrical around 0' as I indicated.. I think I have just been drinking too much coffee.. or something.
Thanks, -Pete ----- Original Message ----- From: "Pete Black" <pbl...@parkroad.co.nz> To: "OpenImageIO developers" <oiio-dev@lists.openimageio.org> Sent: Sunday, April 19, 2015 11:12:17 AM Subject: Re: [Oiio-dev] Advice wanted: how should invert work? Hi Larry, Personally, I think I would prefer 'simple' inversion by default. an alpha-aware optional mode might be useful, but if the operation is a basic 'inversion' i guess i expect all channels i pass in to be inverted independently and premult would be something i would expect to do myself or explicitly specify as an option. That being said i'm not sure if there are conventions for this operation from photoshop or other image processors that might put more weight on the 'premult' approach Also, what about values outside the range 0.0 -> 1.0? it seems like 1.0-x would result in values outside the 0-1 range not being 'symettrical' around 0 which would be unexpected for me I think. Thanks, -Pete On April 19, 2015 10:41:04 AM GMT+12:00, Larry Gritz <l...@larrygritz.com> wrote: By request, I'm implementing IBA/oiiotool "invert", which computes 1-value for all pixels. For example (.25,.5,.25) -> (0.75,0.5,0.75) But I'm not sure what the most helpful behavior is for an image with alpha. Generally, we would like the alpha channel itself to be excluded from the inverse. For example, (.25,.5,.25,1) -> (.75,.5,.75,1), NOT (.75,.5,.75,0). We don't want to suddenly make parts of the image that were opaque, turn transparent. But what about pixels with partial alpha? Is the inverse of (.25,.5,.25,0.5) -> (.75,.5,.75,.5) ? Or should it un-premultiply, invert, and then premultiply again, yielding (.25, 0, .25, .5)? If the answer is "could be either one, depending on the situation", then do you think I ought to make it an option to the invert function, or do you think invert should do the bare mathematical inversion and trust that if the user wants it done in unpremultiplied space, that they will call explicitly unpremult before and premult after? Guidance appreciated. -- Larry Gritz l...@larrygritz.com Oiio-dev mailing list Oiio-dev@lists.openimageio.org http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org _______________________________________________ Oiio-dev mailing list Oiio-dev@lists.openimageio.org http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
_______________________________________________ Oiio-dev mailing list Oiio-dev@lists.openimageio.org http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org