A lightning fast image optimization API, built on top of imagemin for Node.js.
Welcome to the quick-start! Below are some examples for common ways of using the API via cURL
.
Also be sure to check out the full reference of API endpoints.
This API is a hosted version of the open source imagemin library. The examples here show how to use the library via an API endpoint.
The following image formats are supported:
png
jpg
/jpeg
webp
svg
gif
Providing an image URL is the easiest way to use this API.
curl --request POST -o optimized.png \
--url 'https://ssfy.sh/dev/imagemin/optimizeImageUrl' \
--header 'content-type: application/json' \
--data '{"url":"https://octodex.github.com/images/original.png"}'
- Before: 36582 bytes
- After: 20176 bytes
- Savings: 45%
All PNG optimizations make a best effort to remain lossless.
You can also provide binary image data as the body of POST requests. Try replacing the image path with your own local test image.
curl --data-binary '@./examples/test-0.png' -o optimized.png \
'https://ssfy.sh/dev/imagemin/optimizeImage'
See the following docs for more info on curl's
--data-binary
option.
- Before: 71834 bytes
- After: 29579 bytes
- Savings: 59%
MIT © Saasify