Powerful API for image conversion and manipulation.
This project provides a hosted API for sharp by Lovell Fuller.
We set aside the majority of any revenue generated from this API for the original OSS developers. If you are one of these devs, please check out our mission and get in touch to setup payouts and answer any questions you may have.
The following examples can all be invoked with the following curl template by changing out the example.json file:
curl -X POST -d '@example.json' \
'https://ssfy.sh/dev/sharp'
example.json
{
"input": "https://octodex.github.com/images/original.png"
}curl -X POST -d '@example.json' -o out.png \
'https://ssfy.sh/dev/sharp'
example.json
{
"input": "https://octodex.github.com/images/original.png",
"ops": [
{
"op": "jpeg"
}
]
}curl -X POST -d '@example.json' -o out.jpg \
'https://ssfy.sh/dev/sharp'
Here's this example as a GET request: /?input=https://octodex.github.com/images/original.png&ops[0][op]=jpeg.
example.json
{
"input": "https://octodex.github.com/images/original.png",
"ops": [
{
"op": "resize",
"options": {
"width": 220,
"height": 128,
"fit": "contain"
}
},
{
"op": "webp"
}
]
}
curl -X POST -d '@example.json' -o out.webp \
'https://ssfy.sh/dev/sharp'
example.json
{
"input": "https://octodex.github.com/images/original.png",
"ops": [
{
"op": "blur",
"sigma": 10
},
{
"op": "flip"
}
]
}
curl -X POST -d '@example.json' -o out.png \
'https://ssfy.sh/dev/sharp'
example.json
{
"input": "https://octodex.github.com/images/original.png",
"ops": [
{
"op": "tint",
"rgb": "#7743CE"
},
{
"op": "removeAlpha"
},
{
"op": "png",
"options": {
"compressionLevel": 7
}
}
]
}
curl -X POST -d '@example.json' -o out.png \
'https://ssfy.sh/dev/sharp'
example.json
{
"input": "https://octodex.github.com/images/original.png",
"ops": [
{
"op": "metadata"
}
]
}curl -X POST -d '@example.json' -o out.json \
'https://ssfy.sh/dev/sharp'
output (JSON)
{
"format": "png",
"size": 36582,
"width": 896,
"height": 896,
"space": "srgb",
"channels": 4,
"depth": "uchar",
"density": 72,
"isProgressive": false,
"hasProfile": false,
"hasAlpha": true
}The following sharp image operations are supported.
All op names and parameters mirror the sharp docs exactly.
- rotate
- flip
- flop
- sharpen
- median
- blur
- flatten
- gamma
- negate
- normalize
- convolve
- threshold
- boolean
- linear
- recomb
- modulate
This SaaS project was bootstrapped with Saasify.
MIT © Saasify




