Skip to content
yutils
Example

Input

photo.jpg (4032×3024) · locked 16:9 ratio · selection 3200×1800

Output

photo-cropped.jpg (3200×1800)

Note

Locking the ratio keeps 16:9 while you drag. Choose PNG to keep the cropped pixels untouched, or JPEG for a smaller file.

Usage / FAQ

When to use

  • Square off a profile picture to 1:1
  • Cut a 16:9 or 1.91:1 region for thumbnails and OG images
  • Keep only the relevant part of a screenshot and drop identifying details around it
  • Trim empty margins from a scanned document
  • Match the exact aspect ratio an upload form demands

FAQ

Q.Does cropping lose quality?
A.Saving as PNG is lossless — the cropped pixels are preserved exactly. JPEG re-compresses on save, so there is a small loss: lossless JPEG cropping only works on 8×8 block boundaries, and a browser canvas works with arbitrary coordinates, so re-encoding is unavoidable.
Q.Is my file uploaded anywhere?
A.No. Decoding, cropping and saving all happen in the browser through the Canvas API. Nothing leaves your machine.
Q.What is the difference between a locked ratio and free selection?
A.Free selection follows your drag exactly; a locked ratio keeps the chosen width-to-height proportion while you drag. Picking "original" locks it to the uploaded image's own ratio — handy when you only want to shave off margins without changing the shape.
Fun facts
  • JPEG compresses in 8×8 pixel blocks. Crop exactly on those block boundaries and the image can be cut without re-encoding at all (this is what jpegtran's lossless crop does) — crop anywhere else and re-compression is mandatory.

    Wikipedia — JPEG
  • 16:9 was chosen by arithmetic. In the 1980s Kerns Powers of SMPTE overlaid the aspect ratios then in use (1.33:1 through 2.35:1) at equal area and found their average sat at roughly 1.78:1 — which became the HDTV standard.

    Wikipedia — 16:9 aspect ratio
  • Phone photos are stored the way the sensor read them; how far to rotate for display lives only in the EXIF Orientation tag. That's why images appear sideways in software that ignores the tag — and why a rotate button can work without touching a single pixel.

    Wikipedia — Exif