Skip to content

BUG/ENH: Proper gif/anim support in Report #11358

@larsoner

Description

@larsoner

The add_stc is big in the report:

 Source: Auditory                                          |  7.5 MB
 Source: Visual                                            |  7.6 MB
 Source: Auditory/Left                                     |  7.5 MB
 Source: Auditory/Right                                    |  7.5 MB

Trying to fix this, I noticed that image_format='gif' isn't really supported properly. It is supported (I think?) when doing report.add_image, but for Report(..., image_format='gif') things are very broken. So I propose:

  1. Add image_format='webp' format support for smaller file sizes now that matplotlib 3.6+ supports it: ENH: Add webp support to Report #11359
  2. Remove image_support='gif' support for Report as a class
  3. Add image_format=None kwarg to add_stc and add_evokeds, add_slider -- anything that supports a slider.
  4. Make image_format='gif' work properly when making a slider by selecting frames from the GIF rather than changing to different images. (This should hopefully make the images smaller, at least in some cases.)
  5. Add proper image_format='webp' support for animations by natively storing the frames in webp format -- this will hopefully be even smaller than GIF.

I already have (1) done because it's pretty easy. I'll open a PR for that, then later a separate one for 2-5 probably after doing some tests that (4) and (5) could actually save some space.

EDIT: Goal is to improve the ~60MB reports in mne-tools/mne-bids-pipeline#682

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions