Skip to content

Optimisation: Use dummy frames for repeated images #210

@ace-dent

Description

@ace-dent

ImageMagick with layers optimize-plus uses a nice optimisation technique:

  • For animations that have repeated images: 1-2-1-...
  • Frame 0, disposal=1. Frame 1, disposal=3 (restore to previous).
  • Frame 3 is then a 'dummy' 1x1px image (since we restored Image 1), to maintain the delay timing. Ideally we color the pixel using the same color from the first pixel to avoid local palettes. IM strategy is to create a 1bit transparent pixel, since this might be more robust, but adds more bytes for the local palette.
  • The next frame is then a full (or delta) image as normal.

This can save some bytes. Example here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions