gif-animation icon indicating copy to clipboard operation
gif-animation copied to clipboard

white rectangles when decoding certain color tables

Open d3v-null opened this issue 3 years ago • 1 comments

Hi there! I have a gif, which displays correctly in most programs or browsers I've used, however when I open it with gif-animation, white rectangles appear in different places on the gif as the animation progresses. I believe there is an issue decoding the image.

Here is the gif and the example code I used to test if it was working (based off the gifDisplay example, just move the mouse around to go between frames).

import gifAnimation.*;

PImage[] animation;
Gif loopingGif;
Gif nonLoopingGif;
boolean pause = false;

public void setup() {
  size(480, 480);
  frameRate(100);
  
  println("gifAnimation " + Gif.version());
  animation = Gif.getPImages(this, "Cl8NHgAB1cTnIuJRT5.gif");
}

void draw() {
  background(255 / (float)height * mouseY);
  image(animation[(int) (animation.length / (float) (width) * mouseX)], width - 10 - animation[0].width, height / 2 - animation[0].height / 2);
}

original gif (notice the lack of white boxes):

Cl8NHgAB1cTnIuJRT5

what it looks like in gif-display: ezgif-4-2311754a7b3e

Any ideas?

Cheers.

d3v-null avatar Oct 11 '21 04:10 d3v-null

When I use the ezgif optimization called "Single color table for all frames", it seems to fix this!

https://ezgif.com/optimize/ezgif-4-f13e01875851.gif ezgif-4-6107d24951ba

d3v-null avatar Oct 11 '21 04:10 d3v-null