extrapixel / gif-animation

GifAnimation is a Processing library to play and export GIF animations
GNU General Public License v3.0
171 stars 38 forks source link

white rectangles when decoding certain color tables #33

Open d3v-null opened 2 years ago

d3v-null commented 2 years ago

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 commented 2 years ago

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