Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong bounding box? when using the color black in an animation #40

Open
oli4warin opened this issue Oct 8, 2024 · 1 comment
Open

Comments

@oli4warin
Copy link

In certain constellations there seems to be a problem with the color black in show_animation:
As in the example below, the large black square in the second frame is not fully displayed.
If you change the color from black to red, everything works as desired.

from pytamaro import (
    overlay,
    ellipse, rectangle, 
    red, green, black, 
    show_animation
)

show_animation(
    [
        rectangle(120,120,black),
        overlay(ellipse(10,10,green),rectangle(120,120,black))
    ], 
    duration=1000
)

It might be related to the default background color in generating the gif.

image
image

@lucach
Copy link
Contributor

lucach commented Oct 8, 2024

Hi @oli4warin, thanks for reporting this!

We bumped into this weird behavior a while ago (internal issue: https:/LuCEresearchlab/pytamaro-web/issues/242). It turns out to be a bug in the optimizer of Pillow's GIF encoder. We reported the issue upstream and it has already been fixed. The bugfix will be part of Pillow 11, which is scheduled to be released on October 15.

I will release a new version of PyTamaro as soon as the new version of Pillow is released. I'm keeping this issue open to track this process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants