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

support gif image compress #115

Open
Alkaidcc opened this issue Feb 4, 2024 · 3 comments
Open

support gif image compress #115

Alkaidcc opened this issue Feb 4, 2024 · 3 comments

Comments

@Alkaidcc
Copy link

Alkaidcc commented Feb 4, 2024

What problem does this feature solve?

any plan for supporting gif image compress?

What does the proposed API look like?

imagemin({
    mode: 'sharp',
    compress: {
      gif: {}
    }
  }),
@ErKeLost
Copy link
Member

ErKeLost commented Feb 4, 2024

Neither squoosh nor sharp supports gif compression, so you may need to consider the cost of supporting this format. Do you have any good suggestions?

@Alkaidcc
Copy link
Author

Alkaidcc commented Feb 5, 2024

Dose sharp not support gif compression? https://sharp.pixelplumbing.com/api-output#gif
Can we use below?

await sharp('in.gif', { animated: true })
  .gif({ interFrameMaxError: 8 })
  .toFile('optim.gif');

Optimal
The features of mozjpeg and pngquant can be used to optimise the file size of JPEG and PNG images respectively, without having to invoke separate imagemin processes.
Huffman tables are optimised when generating JPEG output images without having to use separate command line tools like jpegoptim and jpegtran .
PNG filtering is disabled by default, which for diagrams and line art often produces the same result as pngcrush .
The file size of animated GIF output is optimised without having to use separate command line tools such as gifsicle .

@ErKeLost
Copy link
Member

ErKeLost commented Feb 5, 2024

Oh, I'm so sorry I missed this. I'll add gif compress

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