google / mediapy

This Python library makes it easy to display images and videos in a notebook.
https://pypi.org/project/mediapy/
Apache License 2.0
389 stars 18 forks source link

`show_video` with a list of rgba images #50

Closed maxencefaldor closed 1 month ago

maxencefaldor commented 1 month ago

Is it possible to use show_video with a list of rgba images (i.e., with a transparency channel).

hhoppe commented 1 month ago

Could you please say more about the desired use case? Is it to render above something else within the notebook? Or to export a video file with transparency? Or do you simply wish to ignore the alpha channel?

For show_video, mediapy currently supports either the h264 or gif codec (as these are widely adopted in HTML video and img tags). The H.264 codec does not support transparency. With GIF it may be possible to specify some pixels to be fully transparent, but not partially transparent.

maxencefaldor commented 1 month ago

My use case is to export a video file with transparency and also visualize it within a notebook. I don't want the alpha channel to be ignored.

I see, I need partial transparency for my use case.

Thank you for your quick answer.