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

`codec="gif"` gives not RGB color #2

Closed JiahaoYao closed 3 years ago

JiahaoYao commented 3 years ago

Hi mediapy, This is an AWESOME tool! One quick question

When I use the codec="gif", the color is not right; image

But if I remove that, the color is back: image

Do I miss some parameters in order to have the rgb color?

Again, thanks for open-sourcing this wonderful tool!

hhoppe commented 3 years ago

Hi Jiaho, GIF can unfortunately only represent a total of 256 distinct colors, so sometimes it doesn't behave well when there are many unique colors (maybe due to the antialiasing in your frames?). But your result does look unusual. Possibly you could share the example data so we can investigate? Thanks.

JiahaoYao commented 3 years ago

Hi @hhoppe , thanks for your fast reply! Here is the colab to reproduce the results.

hhoppe commented 3 years ago

Thanks to the example, I found the problem and a fix; it will be posted in a few days.

JiahaoYao commented 3 years ago

Great, thanks @hhoppe !