Common Image & Avatar Aspect Ratios
Different digital platforms mandate precise image dimensions and aspect ratios:
- 1:1 square and circular avatars:WeChat, Discord, and Twitter use 1:1 avatars. The circular mode renders clean transparent corners in PNG format.
- 16:9 widescreen ratio:Standard widescreen resolution (1920x1080) for YouTube thumbnails and social banners.
- Rule-of-thirds alignment:The built-in rule-of-thirds grid guides optimal placement of faces and focal subjects.
What happens in the page
loadImg() turns the dropped file into an object URL and waits for the decode, getCropBox() converts the selection rectangle you dragged back into source-image coordinates using the current zoom and pan, and draw() paints the visible canvas. resetTransform() restores the original view. Export renders the crop into a second canvas sized to the selection and calls toDataURL() on it — quality 0.95 for JPEG, lossless for PNG — then triggers a download from the data URL.
Where it breaks down
Output size is bounded by the browser's canvas ceiling, so an unusually large photo is scaled to stay inside it rather than exported at full resolution. Only PNG and JPEG are produced: JPEG discards the alpha channel, so a transparent crop comes back with a solid background. EXIF orientation is not restored after re-encoding, which is why phone photos can arrive rotated. A selection narrower than one pixel rounds to zero and is refused.
Privacy: no data leaves this tab
The photo is read through an object URL created from your own file, painted onto a local canvas and re-encoded there. There is no upload step, and the site has no backend to upload to.
Frequently asked questions
Why is my export smaller than the original?
Canvas dimensions have a ceiling. When the crop would exceed it the export is scaled down, so the pixel count drops even though the framing is exact.
Where did the transparent background go?
JPEG has no alpha channel. Choose PNG if the crop needs to stay transparent.
Does cropping reduce quality?
PNG export is lossless; JPEG re-encodes once at the quality you set. Cropping does not resample, so a 1:1 crop keeps every pixel it covers.