Skip to content

Comments

[WIP] Add support to save apng#598

Open
typemytype wants to merge 1 commit intomasterfrom
apng
Open

[WIP] Add support to save apng#598
typemytype wants to merge 1 commit intomasterfrom
apng

Conversation

@typemytype
Copy link
Owner

No description provided.

@typemytype
Copy link
Owner Author

some testing needs to be added

@typemytype
Copy link
Owner Author

argl tests are failing...

@typemytype typemytype changed the title Add support to save apng [WIP] Add support to save apng Feb 21, 2026
@justvanrossum
Copy link
Collaborator

Are you sure you can't leverage Pillow's apng support more instead of implementing all this low level stuff?

https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#apng-sequences

@typemytype
Copy link
Owner Author

DrawBot does not embed PIL, we only use it for testing.

(it worked here locally)

@typemytype
Copy link
Owner Author

reading all the errors:

With .gif we support:

  • single frame -> static .gif
  • multiple frame -> animated .gif

if DrawBot does the same for png/apng, lots of scripts will generate animated pngs instead of the png of the last frame only. That is what the tests traceback indicate.

possible solutions:

  • fix all test by adding a pageNumber argument when a static png is required
  • add a additional animate flag in saveImage("myPath.png", animate=True), different from the .gif behavior (so .gif should change)

@justvanrossum
Copy link
Collaborator

(Need to think about the api consequences)

There’s no reason we couldn’t bundle Pillow, no?

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

Successfully merging this pull request may close these issues.

2 participants