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

gif generated size is too large #2376

Closed
banli17 opened this issue Sep 19, 2020 · 4 comments
Closed

gif generated size is too large #2376

banli17 opened this issue Sep 19, 2020 · 4 comments

Comments

@banli17
Copy link

banli17 commented Sep 19, 2020

I made a gif animation from the picture below,this jpg is only 380kb , but the result gif is too big, 1.2M, but I see others only 400kB, I use the compression tool imagemin to compress, even colors 24 still has 560kb, and it is better than others' The picture is sharper. colors 64 is good, but there are 850Kb.

sharp('./2.jpg').gif({
  loop: 0,
  pageHeight: 240,
  delay: [
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150
  ],
}).toFile('./x.gif')
@lovell
Copy link
Owner

lovell commented Sep 19, 2020

Thanks for the report, I've added commit 6c5cde3 to ensure sharp takes advantage of existing GIF optimisation features of libvips+magick.

@lovell lovell added this to the v0.26.1 milestone Sep 19, 2020
@lovell
Copy link
Owner

lovell commented Sep 20, 2020

v0.26.1 is now available with this change.

@lovell lovell closed this as completed Sep 20, 2020
@banli17
Copy link
Author

banli17 commented Sep 20, 2020

@lovell It doesn't seem to work. After I installed sharp 0.26.1, it is still that big, 1.3MB

sharp('./2.jpg').gif({
  loop: 0,
  pageHeight: 240,
  delay: [
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150, 150, 150, 150, 150,
    150
  ],
}).toFile('./x.gif')

@adityapatadia
Copy link

Is there any more work pending here? We currently see output is not optimised.

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

No branches or pull requests

3 participants