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

Question: Regarding image size #23

Open
VincentVToscano opened this issue Apr 12, 2022 · 0 comments
Open

Question: Regarding image size #23

VincentVToscano opened this issue Apr 12, 2022 · 0 comments

Comments

@VincentVToscano
Copy link

Thanks for creating this plugin. I am using imagemin-cli and wanted to get your feedback regarding how to use the size option. I am attempting to use the desired file size over percent but am not seeing the final file size reduced to (in this case) 100 kb. Perhaps I am not using it correctly. While I am not getting errors in the console, I am also not seeing it reduced to the target size. Greatly appreciate your feedback when you have a moment.
Details of my setup:

"imagemin-cli": "^7.0.0",
"imagemin-jpegoptim": "^8.0.0",
"imagemin-pngquant": "^9.0.2",

I have this in my package.json. The find command fixes the issues whereby I keep my assets directory structure (they have a new feature that hasn 't been merged yet that addresses this). I have tried dropping the curly brackets as well.:

"_optimize-images": "find ./assets/src/ -type f | xargs -I % sh -c 'imagemin --plugin.jpegoptim.size={100} --plugin.pngquant.quality={0.1,0.2} % -o ../build/$(dirname %)'"

That resulting image is 3 kb less than the original: 161 kb. Thanks for your help in advance.

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

1 participant