MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _supports_transparency

Method _supports_transparency

lib/matplotlib/animation.py:528–540  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

526 _args_key = 'animation.ffmpeg_args'
527
528 def _supports_transparency(self):
529 suffix = Path(self.outfile).suffix
530 if suffix in {'.apng', '.avif', '.gif', '.webm', '.webp'}:
531 return True
532 # This list was found by going through `ffmpeg -codecs` for video encoders,
533 # running them with _support_transparency() forced to True, and checking that
534 # the "Pixel format" in Kdenlive included alpha. Note this is not a guarantee
535 # that transparency will work; you may also need to pass `-pix_fmt`, but we
536 # trust the user has done so if they are asking for these formats.
537 return self.codec in {
538 'apng', 'avrp', 'bmp', 'cfhd', 'dpx', 'ffv1', 'ffvhuff', 'gif', 'huffyuv',
539 'jpeg2000', 'ljpeg', 'png', 'prores', 'prores_aw', 'prores_ks', 'qtrle',
540 'rawvideo', 'targa', 'tiff', 'utvideo', 'v408', }
541
542 @property
543 def output_args(self):

Callers 1

saveMethod · 0.45

Calls 1

PathClass · 0.85

Tested by

no test coverage detected