Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressing GIF (no rescale) results in broken GIF ~100 times larger than original #199

Closed
simondud opened this issue Mar 1, 2024 · 1 comment

Comments

@simondud
Copy link

simondud commented Mar 1, 2024

Compressing a 81 x 75 px. gif results in a visually broken gif size 7622 x 9472 px. The command is:

gifsicle -O3 in.gif --colors 256 -o out.gif

I have attached the gif file that shows the problem:
in

@kohler
Copy link
Owner

kohler commented Mar 1, 2024

Hi, if you use gifsicle -I you can see some info about the initial contents of the gif. Its initial frames are very far out of scope:

kohler@Eddies-MacBook-Pro-4 gifsicle % src/gifsicle -I ~/Downloads/309186137-5026dd29-33f9-4d8d-85a8-bb091cbafb21.gif  
* /Users/kohler/Downloads/309186137-5026dd29-33f9-4d8d-85a8-bb091cbafb21.gif 291 images
  logical screen 81x75
  global color table [256]
  background 0
  + image #0 80x74 transparent 0
    disposal asis delay 0.32s
  + image #1 74x74 at 5106,9398
    local color table [2]
    disposal asis delay 0.06s
  + image #2 74x74 at 5106,9398
    local color table [2]
    disposal asis delay 0.14s
  + image #3 74x74 at 7548,4662
    local color table [2]
    disposal asis delay 0.04s
  + image #4 74x74 at 7548,4588
    local color table [2]
    disposal asis delay 0.08s
  + image #5 80x10 at 680,1550
    local color table [64]
    disposal asis delay 0.12s
  + image #6 74x74 at 7548,4662
    local color table [2]
    disposal asis delay 0.04s
  + image #7 74x74 at 7548,4588
    local color table [2]
    disposal asis delay 0.04s
  + image #8 80x10 at 680,1550
    local color table [64]
    disposal asis delay 0.02s
  + image #9 74x74 at 5698,6956
    local color table [2]
    disposal asis delay 0.02s
...

Gifsicle by default expands the output gif to include all frames of all inputs. That's the wrong choice for this gif. There needs to be an option that does the right thing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants