If I understand you correctly, this is the correct behavior. Paste (just like 
pasting text over a selection in an editor) *replaces* what's there. If you 
want to composite (using alpha to, in essence, select where the fg goes and 
where the bg is preserved), then that's exactly what over() does. Or am I 
misunderstand what you're Ofer?

I think it's just unclear documentation. There is only one roi parameter: 
srcroi. I kind of mis-wrote it C++ fingers, so it says

        ROI srcroi=ROI.All

but that first "ROI" is a type, not another parameter.

        -- lg


> On Jan 13, 2021, at 2:06 PM, Daniel Flehner Heen <[email protected]> 
> wrote:
> 
> Hi!
> 
> I'm attempting to slim down some code and want to use ImageBufAlgo.paste() 
> directly rather than ImageBufAlgo.over() to composite a logo with an alpha 
> channel over an image. Is that even possible?
> I keep getting black where it should be transparent. I've made sure the alpha 
> channel is preserved in both the logo and the underlying image.
> 
> According to the docs paste should apply all channels to the according 
> channels in the underlying image. I've tried providing a ROI without success.
> 
> A side question. In the docs 
> <https://openimageio.readthedocs.io/en/latest/pythonbindings.html?highlight=paste#image-transformations-and-data-movement>
>  for ImageBufAlgo.paste there's both a ROI and srcroi argument listed, is 
> that correct or should it only be the srcroi? I suspect the latter.
> 
> Thanks!
> 
> -- 
> -Daniel

--
Larry Gritz
[email protected]




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

Reply via email to