Open
Description
Hi John.
I have some trouble understanding the composite function.
Image used in the example : img
The aim here is to have an image of size 3000 x 3000 with cat and black background.
>>> img = pyvips.Image.new_from_file("cat.jpg")
>>> black = pyvips.Image.black(3000,3000,bands=img.bands)
>>> together = black.composite(img,"over")
>>> together
<pyvips.Image 3000x3000 uchar, 4 bands, multiband>
>>> img
<pyvips.Image 1024x576 uchar, 3 bands, srgb>
>>> black
<pyvips.Image 3000x3000 uchar, 3 bands, multiband>
Why does the number of bands change?
Another option would be to use draw_image, but that always assumes that the image have 1 or 3 bands which is not always the case.
Best regards