-
Notifications
You must be signed in to change notification settings - Fork 4
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
Routine feature request: shrink png images #14
Comments
Motivation and MVP: rstudio/bslib#521 |
I like the idea of running It would be nice if it could quickly detect and skip files that are already optimized. In my experience, if there are a large number of PNGs, it can take a nontrivial amount of time to run. That said, there's not likely to be a lot of PNGs in /man/figures and /vignettes. |
Good point @wch. Maybe we could limit optipng to |
It might make sense to just do it, if in practice it doesn't add a huge amount of time. We could also use a program that's faster than OptiPNG. I came across an interesting discussion of PNG optimizers here: https://news.ycombinator.com/item?id=31655651 It sounds like ECT is very good in terms of speed and file size, but it doesn't seem easy to install. oxipng also looks good, and I think is more widely available. |
Apparently oxipng is a rewrite of optipng in Rust. I just tested it against optipng, and it looks like it's about 30% faster on my machine. I think oxipng may be the way to go. |
It'd be helpful to add an action that
optipng
optipng
on a list of directories provided to the actionThe actual code might look something like this:
but it'd be extra helpful to allow an array input of directories.
The text was updated successfully, but these errors were encountered: