Image cropping selects a rectangular portion of a picture to control composition, aspect ratio, and pixel dimensions while improving consistency across platforms. Rotation, flipping, and zoom refine orientation and framing without altering underlying content. Consistent crops help banners, thumbnails, and product photos align across channels and reduce file size for faster delivery and predictable layouts in responsive contexts.
You load an image locally, choose a free, original, fixed, or custom ratio, and optionally set target width or height. A client-side canvas renders the region with smoothing, then exports PNG, JPEG, or WebP. The tool reports dimensions and estimated size, and can generate JSON or CSV summaries describing inputs, crop geometry, and output characteristics for documentation or automation.
For example, crop a portrait to 4:5 for a marketplace listing, then export a 1200×1500 JPEG with a white background and moderate quality. Avoid heavy upscaling; enlarging beyond the crop’s native resolution reduces sharpness and may introduce compression artifacts that are visible on high-density displays.
Digital cropping constrains an image to a user-defined rectangle, then optionally rescales that region to requested output dimensions. Two ideas govern results: aspect ratio, the proportional relationship between width and height, and resampling, which estimates new pixel values when scaling. Output encoding further affects size and quality: PNG is lossless and supports transparency; JPEG and WebP can be lossy and use a tunable quality factor.
Aspect ratio r is width divided by height.
Let the crop rectangle be Wc by Hc. If you request an output width Wo (height optional), the scale factor is:
If instead you specify only height, use s = Ho / Hc. Output dimensions follow:
The processing sequence is: choose ratio; position crop; compute scale from requested dimension(s) or keep native; render the cropped region to a canvas with high-quality smoothing; encode to the selected format using a quality factor (where applicable) and an optional background color for non-alpha encoders.
Format | Compression | Transparency | Quality control | Typical use |
---|---|---|---|---|
PNG | Lossless | Yes | Not applicable | Logos, UI, graphics needing crisp edges |
JPEG | Lossy | No | Quality factor (10–100%) | Photos where small files are preferred |
WebP | Lossy or lossless | Yes | Quality factor (10–100%) for lossy | Modern web delivery with good efficiency |
PNG ignores the quality slider and preserves transparency. JPEG and lossy WebP apply the chosen quality factor; transparent pixels are composited onto the selected background color before encoding.
Parameter | Meaning | Unit/Datatype | Typical range | Notes |
---|---|---|---|---|
aspect | Free, original, fixed, or custom ratio | String | free · original · 1:1 · 16:9 · 4:3 · 3:2 · 2:3 · custom | Custom uses ratioW:ratioH |
ratioW, ratioH | Custom ratio components | Positive integers | 1–100 | Used only when aspect is custom |
outputWidthReq | Requested output width; 0 keeps crop width | Pixels | 0–8192 | Height auto-scales if only width is set |
outputHeightReq | Requested output height; 0 keeps crop height | Pixels | 0–8192 | Width auto-scales if only height is set |
format | Export MIME type | image/png · image/jpeg · image/webp | — | Determines encoder and alpha handling |
quality | Encoder quality factor | Number (0.10–1.00) | 0.10–1.00 | Ignored by PNG; mapped from 10–100% |
bgColor | Background used for non-alpha formats | Hex color | #000000–#FFFFFF | Fills transparent pixels for JPEG/WebP |
Example: Original 4000×3000; crop to 4:3 region 2400×1800; request width 1200; export JPEG quality 85%.
Aspect ratio:
Scale from requested width:
Output dimensions:
The resulting file is 1200×900; final bytes depend on image content and encoder quality.
Behavior aligns with the HTML Canvas 2D Context processing model for drawing and encoding, ISO/IEC 10918-1 (JPEG), the PNG Specification (ISO/IEC 15948), and published descriptions of WebP lossy/lossless compression. Standard digital resampling principles apply, including interpolation and antialiasing used by common imaging systems.
This concept processes image content locally and can include personal data visible within images; consider GDPR and CPRA obligations for any downstream handling outside the browser.
Use this sequence to prepare a consistent, web-ready crop.
No. Processing occurs entirely in your browser on a client-side canvas. Nothing is uploaded to a server, and object URLs exist only within your session.
PNG uses lossless compression; there is no tunable quality factor. The slider applies only to lossy encoders such as JPEG and WebP in lossy mode.
A ratio fixes width-to-height proportion. Custom values such as 5:4 or 3:2 maintain composition across sizes by constraining the crop box to that proportion.
JPEG does not support an alpha channel. Transparent pixels are flattened onto your chosen background color before encoding, producing fully opaque output.
Moderate upscaling is acceptable but cannot add detail. Keep targets close to the crop’s native size to avoid softness and amplified compression artifacts.
Encoders analyze content. Flat colors and simple textures compress smaller, while noise, grain, and fine detail produce larger files at the same quality setting.