Dev.to WebDev 🛠 Dev 👁 0 📖 7 min read

How a Privacy-First Online Image Editor Works Without Uploading Your Photos (WebAssembly + On-Device AI)

Most online image editors follow the same pattern. You pick a file, the browser uploads it, a server processes it, and a result comes back. It is simple to build, and it quietly means every photo you edit passes through

Most online image editors follow the same pattern. You pick a file, the browser uploads it, a server processes it, and a result comes back. It is simple to build, and it quietly means every photo you edit passes through someone else's infrastructure.

Browsers no longer need that arrangement. With WebAssembly, the Canvas API, and models that run on the client, the work of a photo editor, background remover, and image converter can happen on the device in front of you.

Akhouri Systems built APIC, a free browser-based editor, around that constraint. This article documents how a privacy-first online image editor is put together when nothing is uploaded, which trade-offs come with that design, and what users can reasonably expect from it.

Why "no upload" is an architecture decision, not a slogan

Privacy claims are cheap. Architecture is harder to fake.

When image processing happens on a server, privacy depends on policy: retention windows, access controls, and trust. When processing happens on the device, the image never leaves the browser tab, so there is nothing to retain and nothing to leak in transit.

That changes a few things for anyone building or choosing an online photo editor:

  • Sensitive images stay local. ID photos, product prototypes, client work, family pictures.
  • There is no upload queue. Speed depends on the user's hardware, not on server load.
  • Large files are no longer a bandwidth problem. A 40 MB photo does not need to travel anywhere.
  • Offline use becomes possible. After the first load, much of the tooling does not need a connection.

The cost is that the client has to do real work. The rest of this article is about how that work gets done.

The building blocks of a browser-based image editor

1. Canvas for live editing

Filters, brightness, contrast, saturation, blur, rotation, and flipping are all operations on pixel data, and the Canvas API handles them well. Because the work is local, sliders update the preview live with no round trip.

For more demanding color work, the same approach scales up. APIC's advanced panel includes a live histogram with shadow and highlight clipping indicators, RGB curves, an 8-band HSL mixer, three-way color grading, clarity, and grain. It can also export a 33×33×33 3D LUT as a .cube file, so a grade built in the browser can be reused in tools such as DaVinci Resolve, Premiere, or Photoshop.

One honest limitation: spatial effects like clarity, sharpening, vignette, and grain are not purely color transforms, so they cannot be baked into a LUT. The export covers the color-only parts of the grade.

2. WebAssembly for the heavy lifting

JavaScript alone is not the right tool for neural-network inference on a full-resolution photo. WebAssembly gives near-native execution inside the browser sandbox, which is what makes on-device AI practical. Every AI feature below runs this way.

3. Model caching so the cost is paid once

On-device AI has a real first-run cost: the model has to be downloaded. A well-behaved implementation downloads it once, caches it in the browser, and reuses it afterward.

For background removal, APIC offers three tiers so users can match the model to their device:

Tier First download Best for
Light about 5 MB Phones and quick cut-outs
Fast about 44 MB Everyday use
Maximum about 176 MB Highest accuracy, multi-pass, desktop-class hardware

After the first run, the model loads from cache, and nothing is sent to a server at any point. If a download fails, the app retries automatically and surfaces a retry button rather than failing silently.

On-device AI background removal

Background removal is a segmentation problem: classify every pixel as subject or not, then turn that mask into transparency. Doing this locally means the full-resolution original stays in memory on the user's device.

Two details matter for quality:

  • Edge refinement. Raw masks tend to leave hard or jagged boundaries. A refinement pass smooths them.
  • Color-fringe removal. Pixels at the edge often carry color from the old background. Removing that spill is the difference between a cut-out that looks pasted on and one that looks natural.

For output, keep transparency by exporting to PNG or WebP. JPEG has no alpha channel, so it will flatten the result.

Removing objects with on-device inpainting

Object removal is a different problem from background removal. You paint over what you want gone, such as a stray person, a sign, or a blemish, and a model fills the region so it blends with its surroundings.

APIC uses two engines, which illustrates a useful design pattern, graceful degradation:

  • MI-GAN (about 28 MB) is lightweight enough to run on phones.
  • LaMa, a large Fourier-convolution inpainting network (about 208 MB), gives the most accurate fills for big or complex areas, and is intended for desktop-class devices.

If a model cannot load, the tool steps down automatically: Ultra, then MI-GAN, then a quick patch fill. Only the area around the brush is processed, and the fill is color-matched and re-grained to match the original photo, which avoids the telltale "too clean" patch.

A practical tip that applies to any inpainting tool: paint slightly outside the object, so shadows and reflections are covered too.

Compressing an image to an exact file size

A common real-world task is hitting an upload limit: "under 200 KB" for a form, "under 1 MB" for a CMS. Guessing a quality slider is tedious.

A better approach is to search across quality levels and keep the highest one that fits the target. APIC's compress image online tool works this way. If the target is impossible at any quality, it reduces the dimensions as a fallback and reports the actual resulting size rather than pretending it hit the number.

Resizing without the muddy look

A single large downscale is a classic source of soft, blurry results. Resampling in several half-size steps preserves more detail, and every pixel is recomputed at full quality. The tool leaves the image uncropped and unstretched unless you deliberately change the aspect ratio. You can specify exact pixels or a percentage, with an aspect-ratio lock.

Converting formats: PNG, JPG, WebP, BMP, ICO, PDF

Format conversion is where most people start. The practical rules of thumb:

  • PNG: lossless, supports transparency. Best after background removal.
  • JPEG: small files, no transparency. Best for photos.
  • WebP: small files and transparency. A strong default for the web.
  • BMP: uncompressed.
  • ICO: app and favicon icons.
  • PDF: a single-page document from an image.

All six conversions run locally, so converting a private document scan does not involve a third party.

Social media sizes without the guesswork

Every platform has its own dimensions for profile pictures, banners, covers, posts, and stories, and they change. APIC's Social tab holds exact-size presets for 15 networks, including Instagram, YouTube, Facebook, X, TikTok, LinkedIn, Pinterest, Snapchat, Threads, Bluesky, Discord, Twitch, and Spotify.

Two features make this more useful than a list of numbers: safe-zone guides that show where a platform crops or covers your image, and ZIP export so you can download every size for a network at once.

Batch processing and an offline desktop version

Single-image tools only go so far. A batch studio takes many images through background removal, resizing, compression, and conversion in one pass and returns one ZIP, again processed entirely on the device.

For people who want no browser involved at all, there is also a Windows desktop build that runs fully offline with the edit, convert, and compress tools.

A note on accounts and what data is involved

Being specific here matters, because "no upload" can be misread. The editing tools work without an account. Signing in with Google is optional, and it uses your name, email, and photo for the account. The images themselves are not uploaded.
We request you to signing in APIC even when it is optional because it will help us to send you guys update emails.

Frequently asked questions

What is a privacy-first online image editor?
It is an editor that processes images on your own device instead of sending them to a server. Editing, conversion, compression, resizing, and AI features all run in the browser.

Can AI background removal run without uploading the photo?
Yes. A segmentation model can run in the browser through WebAssembly. The model downloads once, is cached, and processes the image locally.

Is there a free online photo editor that keeps images on-device?
APIC is one. It is free, has no paid tiers, and runs its tools locally.

How do I compress an image to a specific size in KB?
Use a compressor that searches for the highest quality under your target size, such as the Compress tool in APIC.

Which format keeps a transparent background?
PNG and WebP. JPEG does not support transparency.

Does it work on phones?
Yes. Lighter model tiers exist specifically for phones, with heavier ones recommended for desktop hardware.

Where to try it

If you want to see these techniques in practice, APIC is a free online photo editor, background remover, and image converter that runs in your browser, with no uploads of your images.

We are interested in how other engineers approach on-device processing. Which tasks have you moved from the server to the client, and what held you back? Share your experience in the comments.

About Akhouri Systems: we build software with privacy and performance as design constraints. Follow our dev.to organization for more engineering write-ups.

WE BUILD WHAT OTHERS FORGOT TO FIX

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.