Skip to content

Gif conversion causes artifacting when gif has alpha transparency #1908

@landaire

Description

@landaire

Checklist

  • I am reporting an issue in existing functionality that does not work as intended
  • I've searched for existing GitHub issues

Description

Conversion from GIF to MP4 causes animated gifs with alpha transparency to have visible artifacting which I believe is caused by not zeroing this buffer for each frame:

CVPixelBufferRef pxBuffer = [self newBufferFrom:imgRef size:renderSize withPixelBufferPool:adaptor.pixelBufferPool andAttributes:adaptor.sourcePixelBufferAttributes];
.

Expected Behavior

The gif should not have artifacts.

Image

Actual Behavior

The gif has artifacts.

IMG_0562.MP4

Steps to Reproduce

  1. Save this file somewhere: https://gist.githubusercontent.com/landaire/4a1ea295c353ef85277c12e35d95fe53/raw/8643a704de1f0bf8532847877001033c25ebcf8d/gistfile1.txt
  2. Decompress it using base64 -d gistfile1.txt | xz -d > alienpls.gif
  3. Send it using Telegram for Mac or iPhone
  4. Observe the artifacts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions