Title: Cleanup Animation frame_formats. by anntzer · Pull Request #19044 · matplotlib/matplotlib · GitHub
Open Graph Title: Cleanup Animation frame_formats. by anntzer · Pull Request #19044 · matplotlib/matplotlib
X Title: Cleanup Animation frame_formats. by anntzer · Pull Request #19044 · matplotlib/matplotlib
Description: Warn if the requested frame format is unsupported and fallback occurs. FFMpegFileWriter does not support 'raw' or 'rgba' (AFAICT there's no way to forward the relevant frame size/bitdepth info). ImageMagickFileWriter supports 'rgba' but requires explicit frame_size and depth to do so (they are the same as for ImageMagickWriter, and passing them doesn't negatively impact other formats), but it does not support 'raw' (per https://imagemagick.org/script/formats.php). Test script: import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation fig, ax = plt.subplots() x = np.arange(0, 2*np.pi, 0.01) line, = ax.plot(x, np.sin(x)) def animate(i): line.set_ydata(np.sin(x + i / 50)) # update the data. return line, ani = animation.FuncAnimation( fig, animate, interval=50, blit=True, save_count=20) plt.rcParams["animation.frame_format"] = "rgba" # or "raw" writer = animation.FFMpegFileWriter() # or animation.ImageMagickFileWriter() ani.save("/tmp/movie.mp4", writer=writer) (Also move import of PIL up, as it's a standard dependency now.) PR Summary PR Checklist Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (run flake8 on changed files to check). New features are documented, with examples if plot related. Documentation is sphinx and numpydoc compliant (the docs should build without error). Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all). New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there). API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
Open Graph Description: Warn if the requested frame format is unsupported and fallback occurs. FFMpegFileWriter does not support 'raw' or 'rgba' (AFAICT there's no way to forward the relevant frame siz...
X Description: Warn if the requested frame format is unsupported and fallback occurs. FFMpegFileWriter does not support 'raw' or 'rgba' (AFAICT there's no way to forward th...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/19044
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:de541370-fdff-1a5e-672d-daaf25785af5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C20C:1D4F69:3296DE:42DE4D:6A52ED7E |
| html-safe-nonce | 65e657683d1e13feefbce5c54c255ce35a5c14c2d9000c78ecbbee38241f111f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjBDOjFENEY2OTozMjk2REU6NDJERTREOjZBNTJFRDdFIiwidmlzaXRvcl9pZCI6IjU0NjczNDc1NTExNTcxNTMxNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6e75a7d20eb714f310a2f91cfd99d16025fe45b6c61a97026b725c7fe48cba49 |
| hovercard-subject-tag | pull_request:529118606 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/19044/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | Warn if the requested frame format is unsupported and fallback occurs. FFMpegFileWriter does not support 'raw' or 'rgba' (AFAICT there's no way to forward the relevant frame siz... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width