# Resize an Image

Resize any image right in your browser — set a width and/or height, pick a fit mode. No upload to a server, runs locally, free.

## Run it

- **CLI:** `gizza tool image-resize 'url=https://example.com/input' 'width=640' 'fit=contain'`
- **Web:** https://gizza.ai/tools/image-resize/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/image-resize/tool.json

## Inputs

- `image` — Image _(file; accept: image/*)_
- `width` — Width (px) _(field)_
- `height` — Height (px) _(field)_
- `fit` — Fit (contain|cover|stretch) _(field)_

## Output

- Resized image (image)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `width` — Width (px)
- `height` — Height (px)
- `fit` — Fit (contain|cover|stretch)
- `url` — fetch the input file from a public URL (CORS-permitting)

Example: `https://gizza.ai/tools/image-resize/?url=https://example.com/input&width=640&fit=contain`

---

## Resize an image in your browser

Pick an image, type a width (and optionally a height), and get a resized copy
instantly. The resizing runs entirely in your browser with ffmpeg compiled to
WebAssembly — your image is never uploaded to a server.

### Fit modes

- **contain** (default) — fit inside the box, keep aspect ratio.
- **cover** — fill the box, keep aspect ratio, crop the overflow (needs both width and height).
- **stretch** — force the exact width × height, ignoring aspect ratio.

### Tips

- Give only a width (or only a height) to scale proportionally.
- Works offline once the page has loaded.

## FAQ

<details>
<summary>Do I need to fill in both width and height?</summary>

No — give just one and the other dimension is computed automatically to keep the
aspect ratio. At least one of the two is required, and both must be positive.
The only mode that insists on both is **cover**, because it has to know the full
box to crop into.

</details>

<details>
<summary>When should I use contain, cover, or stretch?</summary>

**contain** (the default) fits the whole image inside your box without
distortion, so the result can be smaller in one dimension. **cover** fills the
box exactly and crops whatever overflows — ideal for thumbnails and hero images.
**stretch** forces the exact width × height and will distort the picture if the
aspect ratio differs.

</details>

<details>
<summary>Does resizing convert my image to another format?</summary>

No — the output keeps the input's format: a `.jpg` in gives a `.jpg` out, a
`.png` stays `.png`. The file is re-encoded at the new size by ffmpeg, so the
resized copy is a fresh encode rather than a metadata-only change.

</details>

<details>
<summary>Is my photo uploaded anywhere while resizing?</summary>

No. The whole pipeline is ffmpeg compiled to WebAssembly, running inside your
browser tab. The image never leaves your device, and once the page has loaded
the tool keeps working without a network connection.

</details>

## Related tools

- [Shrink an Image for Sharing](https://gizza.ai/tools/image-shrink-for-sharing/): Downscale, strip EXIF metadata, and compress a photo in one step for messaging, email or upload. Runs locally in your browser — nothing is uploaded, free.
- [Pinterest Pin Image Resizer](https://gizza.ai/tools/pin-image-resizer/): Resize and crop any image to a Pinterest pin size right in your browser — 1000×1500 (2:3), square, tall, or story. Smart crop, no upload, free.
- [Replace an Image Background (Chroma Key)](https://gizza.ai/tools/image-bg-replace/): Chroma-key a green-screen or solid-color background out and drop the subject onto a transparent, solid, or gradient background — free, in your browser.
- [Compress an Image](https://gizza.ai/tools/image-compress/): Shrink an image's file size right in your browser — re-encode a JPG, PNG, or WebP at a chosen quality, same format out. No upload to a server, runs locally, free.
- [Convert an Image](https://gizza.ai/tools/image-convert/): Convert any image to JPEG, PNG, or WebP right in your browser — pick a target format and quality. No upload to a server, runs locally, free.
