Free plan
Optimize
Make pictures smaller in file size and choose the best settings


About this tool
Makes the file size of your pictures smaller while they still look good. You can pick the file type, the quality, a target size, a maximum width or height, and whether to keep the hidden details such as camera and date. It gives you more control than automatic shrinking.
For example, you reduce your photos before putting them on a website so the page loads fast.
How to use it
- Choose this tool.
- Add one or more pictures with Upload or drag and drop.
- Choose the file type and quality, or a target size.
- Press Generate.
- Download the smaller pictures.
What you get back
You get a smaller copy of each picture that you can download, and the originals stay as they were.
TEST IT LIVE
Try Optimize in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/optimize
Tool ID
images.optimize
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Image
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/images/optimize" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'images=@photo.jpg' \
-F 'format=jpeg' \
-F 'quality=1' \
-F 'targetSizeKB=1'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.optimize({
"images": 'photo.jpg',
"format": "jpeg",
"quality": 1,
"targetSizeKB": 1
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->optimize([
'images' => 'photo.jpg',
'format' => 'jpeg',
'quality' => 1,
'targetSizeKB' => 1,
]);
echo $result->requestId;Documentation
Guides that use this tool
More in Images
