Web / Done
PasFotoIn Browser Photo Editor
Overview
Browser-based editor for Indonesian ID photos and social crops. Every process runs on the user's device: no uploads, no server, no account. Presets in centimeters (2x3, 3x4, 4x6, 6x9), ICAO-compliant international sizes, automatic subject cutout via an in-browser segmentation model, and an A4 print sheet ready to cut.
Challenge
Running a segmentation model in the browser without freezing the page: inference moved into a Web Worker with multithreaded WASM (65 s down to 30 s), previews capped at 2048 px to keep drag latency low, and a non-destructive edit model so every adjustment can be undone and exported at full resolution.
Result
Live at www.pasfotoin.web.id with 26 presets across ratios, Indonesian document sizes, ICAO sizes, and social media; an 8-stage matte post-processing pipeline; batch ZIP export; and a 300 DPI A4 print sheet, all on-device and covered by Vitest and Playwright suites.
Key Statistics
26 (ratios, documents, ICAO, social)
Presets
100% on-device
Processing
8-stage post-processing
Matte pipeline
PNG, JPEG, WebP + A4 sheet
Export
Technologies
Frontend
-
Next.js
-
React
-
TypeScript
-
Tailwind CSS
State & Storage
- Zustand
- IndexedDB
- localStorage
In-Browser ML
-
ONNX Runtime Web
- Web Worker
- WebAssembly
Export
- PNG
- JPEG
- WebP
- A4 print sheet
Testing
- Vitest
- Playwright
Gallery
Homepage Dropzone
Landing doubles as workspace: drag a photo, paste with Ctrl V, or jump in with one click document shortcuts.
Ratio and Document Presets
Editor canvas with Ratio tab: general ratios, Indonesian centimeter sizes, ICAO sizes, plus Fill and Fit placement modes.
Background and Subject Cutout
Background tab: official red blue white studio colors, gradients, blur, plus on device segmentation in three quality tiers.
Adjust with Histogram and Levels
Adjust tab: six sliders, 256 bin light and RGB histogram, draggable levels, Auto Levels, and detail enhancement.
Export Tab
Export tab: PNG JPEG WebP at quality 40 to 100, preset or custom pixels, 300 or 600 DPI, size estimate, and batch ZIP.
Export Dialog
Export dialog with per file settings, clipboard copy, batch ZIP progress with cancel, and EXIF stripped output.