How Client-Side Photo Resizing Works
Every resize operation runs completely inside your device's web browser using standard Canvas and Web Worker APIs—no file ever travels over the network.
1. EXIF-Safe Image Decoding
Modern Android and iPhone cameras often store photos rotated sideways in pixel order while saving the upright orientation in an EXIF header. We decode images with createImageBitmap(file, { imageOrientation: "from-image" }) so portrait photos appear upright instead of flipping sideways.
2. Background Processing via Web Workers & OffscreenCanvas
Where supported by your browser, encoding runs inside a dedicated Web Worker using OffscreenCanvas so the page stays responsive even when processing a 12 MP smartphone photo. On older browsers without OffscreenCanvas, the tool falls back smoothly to an off-DOM HTMLCanvasElement.
3. Binary Search for Exact KB Targets
JPEG byte size depends non-linearly on both pixel dimensions and compression quality. Instead of guessing a single quality factor, our engine performs a binary search between quality 0.05 and 0.95 (up to 10 probes):
- If you specify width or height (in
pxorcmconverted via DPI), the canvas scales to those dimensions first. - It probes quality 0.95. If the file already fits inside your
[Min KB, Max KB]range, it stops immediately to preserve top sharpness. - If the file is heavier than
Max KB, it binary-searches quality until it finds the highest quality that stays strictly at or belowMax KB. - If even quality 0.05 exceeds
Max KB, it steps dimensions down gradually by 8% per step and re-runs the quality search until the image fits cleanly. - If a file is smaller than
Min KBat maximum quality (common with white-paper signatures), it notifies you and optionally scales dimensions upward smoothly so the file meets the portal minimum.
4. Verifying Zero Uploads Yourself
You can open your browser's Developer Tools (Network tab), load the home page, turn off Wi-Fi or mobile data, and resize a photo offline. The tool continues working with zero network requests.