Converts an uploaded image to a specified format, with optional resizing and quality
adjustment.
Examples
Curl
curl -X POST -H "Content-Type: multipart/form-data" -F "image=@path/to/image.jpg" "https://ica.jeysi.dev/convert?format=png&width=500&height=500"
JavaScript (using fetch)
const formData = new FormData();
formData.append("image", fileInput.files[0]);
fetch("https://ica.jeysi.dev/convert?format=png&width=500&height=500", {
method: "POST",
body: formData,
})
.then((response) => response.blob())
.then((image) => {
// Do something with the image
});
Python (using requests)
import requests
url = 'https://ica.jeysi.dev/convert?format=png&width=500&height=500'
files = {'image': open('path/to/image.jpg', 'rb')}
response = requests.post(url, files=files)
with open('output.png', 'wb') as out_file:
out_file.write(response.content)