What it does
Resize an image to exact pixels or by a percentage, keeping its proportions, without enlarging smaller images.
It reads one AVIF, JPEG, JPG, PNG, TIFF or WEBP file. You get: the resized image.
Step by step on the website
Use Resize Image
Open Resize Image on the website.
Open Resize ImageDrop your AVIF, JPEG, JPG, PNG, TIFF or WEBP file on the page, or choose it.
Choose your settings, or keep the ones already chosen:
- Mode: Pixels or Percentage (Pixels at first). Give exact pixels, or scale by a percentage.
- Width: a number from 1 to 20000 px. Leave one side empty to keep the proportions. Appears when Mode is Pixels.
- Height: a number from 1 to 20000 px. Leave one side empty to keep the proportions. Appears when Mode is Pixels.
- Percentage: a number from 1 to 400% (100% at first). 100% keeps the size; 50% halves it. Appears when Mode is Percentage.
- Keep proportions: switch it on or off (On at first). Work out the other side so the image is not stretched. Appears when Mode is Pixels.
- Format: Same, JPG, PNG, WEBP, AVIF or TIFF (Same at first). Keep the same format, or save as another.
- Quality: a number from 1 to 100% (82% at first). Higher keeps more detail and makes a larger file.
- Background: pick a colour, or type a hex code such as #c62828. Fills transparent areas, which JPG cannot keep.
To fine-tune, open More options:
- Never enlarge: switch it on or off (On at first). Images already smaller than the size stay as they are.
- Fit: Fit inside, Fill and crop or Stretch (Fit inside at first). What happens when the new shape differs from the old one.
- Resampling: Nearest, Cubic, Mitchell, Lanczos 2 or Lanczos 3 (Lanczos 3 at first). The method used to recalculate pixels.
- File name: type a name, or keep the one suggested. Optional. The extension is added for you.
Select Resize Image to run it.
When it finishes, select Download to save your result.
Settings
Every setting, with the name the page shows and the name the API uses. On the page: shown next to your file. More options: under More options. API only: not offered on the website.
| Setting | API name | Choices or values | Default | Where | What it does |
|---|---|---|---|---|---|
| Mode | mode | Pixels (pixels), Percentage (percentage) | Pixels | On the page | Give exact pixels, or scale by a percentage. |
| Width | width | 1 to 20000 px | On the page, when Mode is Pixels | Leave one side empty to keep the proportions. | |
| Height | height | 1 to 20000 px | On the page, when Mode is Pixels | Leave one side empty to keep the proportions. | |
| Percentage | percentage | 1 to 400% | 100 | On the page, when Mode is Percentage | 100% keeps the size; 50% halves it. |
| Keep proportions | maintainAspect | On (true), Off (false) | On | On the page, when Mode is Pixels | Work out the other side so the image is not stretched. |
| Never enlarge | noEnlarge | On (true), Off (false) | On | More options | Images already smaller than the size stay as they are. |
| Fit | fit | Fit inside (inside), Fill and crop (cover), Stretch (fill) | Fit inside | More options | What happens when the new shape differs from the old one. |
| Resampling | kernel | Nearest (nearest), Cubic (cubic), Mitchell (mitchell), Lanczos 2 (lanczos2), Lanczos 3 (lanczos3) | Lanczos 3 | More options | The method used to recalculate pixels. |
| Format | outputFormat | Same (same), JPG (jpg), PNG (png), WEBP (webp), AVIF (avif), TIFF (tiff) | Same | On the page | Keep the same format, or save as another. |
| Quality | quality | 1 to 100% | 82 | On the page | Higher keeps more detail and makes a larger file. |
| Background | background | Text | #ffffff | On the page | Fills transparent areas, which JPG cannot keep. |
| File name | outputName | Text | More options | Optional. The extension is added for you. |
Run it with the API
Upload your file with POST /api/v2/documents, then start Resize Image with POST /api/v2/document-operations and toolId resize-image. The parameters use the API names in the settings table; anything you leave out takes its default. Read the operation until its state is completed, then download the output version.
The request below uses the same starting settings as the website. The script after it does the whole journey: upload, run, wait and download.
{
"documentId": "doc_8kq2W1",
"versionId": "ver_3Jx9Lm",
"toolId": "resize-image",
"parameters": {
"width": 800
},
"idempotencyKey": "resize-image-2026-11-22-1"
}#!/usr/bin/env bash
# Needs curl and jq.
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
set -euo pipefail
API="${WELLFRIEND_API_URL:-https://wellfriend.dev}"
WELLFRIEND_API_KEY="${WELLFRIEND_API_KEY:-YOUR_API_KEY}"
AUTH="Authorization: Bearer $WELLFRIEND_API_KEY"
RUN=$(uuidgen) # reuse this value to retry safely
# upload FILE CONTENT_TYPE KEY: prints the document id and its version id
upload() {
curl -sS --fail-with-body -X POST "$API/api/v2/documents" -H "$AUTH" -H "Idempotency-Key: $3" \
-H "Content-Type: $2" -H "X-Wellfriend-Filename: $(basename "$1")" --data-binary "@$1" \
| jq -r '"\(.document.id) \(.document.currentVersion.id)"'
}
read -r DOCUMENT_ID VERSION_ID < <(upload 'input.jpg' 'image/jpeg' "$RUN-upload")
# Run resize-image
OP=$(jq -n --arg doc "$DOCUMENT_ID" --arg ver "$VERSION_ID" --arg key "$RUN-1" \
--argjson parameters '{"width":800}' \
'{documentId: $doc, versionId: $ver, toolId: "resize-image", parameters: $parameters, idempotencyKey: $key}' \
| curl -sS --fail-with-body -X POST "$API/api/v2/document-operations" -H "$AUTH" \
-H "Content-Type: application/json" -H "Idempotency-Key: $RUN-1" --data-binary @- | jq -r .operation.id)
while :; do
RESULT=$(curl -sS --fail-with-body "$API/api/v2/document-operations/$OP" -H "$AUTH")
STATE=$(echo "$RESULT" | jq -r .operation.state)
case "$STATE" in completed) break ;; failed|cancelled|canceled) echo "$RESULT" >&2; exit 1 ;; esac
sleep 1
done
DOCUMENT_ID=$(echo "$RESULT" | jq -r .operation.outputDocumentId)
VERSION_ID=$(echo "$RESULT" | jq -r .operation.outputVersionId)
# Download the result
curl -sS --fail-with-body "$API/api/v2/documents/$DOCUMENT_ID/versions/$VERSION_ID/content" -H "$AUTH" -o 'input-wellfriend.jpg'Run it with the SDKs
The SDKs upload the file, run resize-image with the same parameters and wait for the result: wf.tools.resizeImage() in TypeScript, wf.tools.resize_image() in Python, wf.Tools.ResizeImage() in Go.
// wellfriend-document-sdk: npm install wellfriend-document-sdk@latest. An ES module (top-level await): save it as .mts.
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import { Wellfriend } from "wellfriend-document-sdk";
const wf = new Wellfriend({ apiKey: process.env.WELLFRIEND_API_KEY ?? "YOUR_API_KEY" });
const result = await wf.tools.resizeImage("input.jpg", { width: 800 });
await result.save("input-wellfriend.jpg");# wellfriend-document-sdk: pip install -U wellfriend-document-sdk
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import os
from wellfriend import Wellfriend
wf = Wellfriend(api_key=os.environ.get("WELLFRIEND_API_KEY", "YOUR_API_KEY"))
result = wf.tools.resize_image("input.jpg", width=800)
result.save("input-wellfriend.jpg")// go get wellfriend.dev/go/wellfriend@latest
package main
import (
"context"
"fmt"
"os"
"wellfriend.dev/go/wellfriend"
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func run() error {
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
apiKey := os.Getenv("WELLFRIEND_API_KEY")
if apiKey == "" {
apiKey = "YOUR_API_KEY"
}
wf := wellfriend.New(wellfriend.WithAPIKey(apiKey))
ctx := context.Background()
res, err := wf.Tools.ResizeImage(ctx, wellfriend.File("input.jpg"), &wellfriend.ResizeImageParams{Width: wellfriend.Float64(800)})
if err != nil {
return err
}
return res.Save(ctx, "input-wellfriend.jpg")
}