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