On-the-fly image resize, crop, convert and optimization API
904
On-the-fly image resize, crop, convert, and optimization API.
docker run -p 8080:8080 ogulcanaydogan/image-resizer
# Resize an image
curl -X POST http://localhost:8080/api/resize \
-F "[email protected]" \
-F "width=800" \
-F "format=webp" \
-o resized.webp
Resize and transform an image.
| Parameter | Description | Default |
|---|---|---|
width | Target width (px) | - |
height | Target height (px) | - |
fit | Resize mode: contain, cover, fill | contain |
quality | Output quality (1-100) | 85 |
format | Output format (jpeg/png/webp/gif) | original |
crop | Crop region: x,y,w,h | - |
rotate | Rotation degrees | - |
grayscale | Convert to grayscale | false |
flip | Flip: horizontal, vertical | - |
Convert image format.
Get image metadata (dimensions, format, mode).
| Variable | Description | Default |
|---|---|---|
PORT | Server port | 8080 |
MAX_UPLOAD_MB | Max upload size (MB) | 50 |
DEFAULT_QUALITY | Default output quality | 85 |
MAX_DIMENSION | Max output dimension (px) | 4096 |
services:
resizer:
image: ogulcanaydogan/image-resizer
ports:
- "8080:8080"
environment:
- DEFAULT_QUALITY=90
- MAX_UPLOAD_MB=100
MIT
Content type
Image
Digest
sha256:b1c05810d…
Size
53.9 MB
Last updated
7 months ago
docker pull ogulcanaydogan/image-resizer