Convert and transform images between formats with resize, rotate, crop, and quality options

Synopsis

convert <input> [operations...] <output>

Description

Reads an image from the virtual filesystem, applies a sequence of transformation operations, and writes the result to an output file. The output format is inferred from the file extension. Powered by ImageMagick compiled to WebAssembly, running entirely in the browser.

Options

-resize WxH Resize to width x height, preserving aspect ratio

-resize WxH! Resize to exact dimensions, ignoring aspect ratio

-resize N% Resize by percentage

-rotate <degrees> Rotate image by the specified degrees

-crop WxH+X+Y Crop to width x height at position X, Y

-quality N Set output quality, 0-100

-h, --help Show help message

Examples

$ convert input.jpg -resize 800x600 output.png

Resize a JPEG to 800x600 and save as PNG.

$ convert photo.png -resize 50% smaller.png

Shrink an image to 50% of its original size.

$ convert image.jpg -rotate 90 -quality 85 rotated.jpg

Rotate 90 degrees and set JPEG quality to 85.

$ convert input.png -crop 100x100+50+50 cropped.png

Crop a 100x100 region starting at coordinates (50, 50).

Notes

This command uses ImageMagick (magick-wasm) compiled to WebAssembly, so it runs entirely in the browser with no server dependency. It follows the same argument syntax as the classic ImageMagick convert command, but supports a subset of operations.

Supported output formats (inferred from extension): JPEG (.jpg, .jpeg), PNG, GIF, WebP, BMP, TIFF (.tiff, .tif), and AVIF. If the extension is unrecognized, PNG is used as the default.

Multiple operations can be chained and are applied in order. Both input and output are VFS paths.

See Also

open