DEV Community

Cover image for How to Build a Privacy-First Image Editor (No Uploads) – APIC Studio
Akhouri Anmol Kumar
Akhouri Anmol Kumar

Posted on

How to Build a Privacy-First Image Editor (No Uploads) – APIC Studio

Uses Canvas API and WebAssembly locally

Most "free" online image editors work like this: you upload your photo, a server edits it, you download the result.

Convenient, but your photo has now left your device, and you don't know who stores it, how long, or what it's used for.

I'm building APIC Studio, a free, browser-based, privacy-first image editor at Akhouri Systems, and its rule is simple: your photo never leaves your device.

This guide covers the design rules and techniques behind that, so you can build your own privacy-first image editing tool.

What does "privacy-first image editor" actually mean?

A privacy-first image editor processes images locally, on the user's own device, instead of sending them to a server. In practice that means:

  • No image uploads
  • No account needed to edit
  • No server-side processing queue
  • Nothing for a breach to leak, because the server never had your photo

The browser can do far more than most people think, so you don't need a backend for this.

Rule 1: Treat "no upload" as an architecture decision

Privacy can't be a setting you add at the end. If your editing pipeline starts with fetch("/upload"), you've already lost.

APIC Studio is built on browser-native tools only:

  • Canvas API for filters, crop, resize, drawing and export
  • WebAssembly for heavy compute
  • An on-device ML model for AI features

The app is a single index.html with no build step. That keeps it small, easy to audit and easy to run on low-end phones.

Rule 2: Run AI on-device, not in the cloud

Background removal is usually the first feature that forces an upload. It doesn't have to.

I use MediaPipe's ImageSegmenter in the browser. The first lesson is about hard masks vs. soft masks.

Category masks (outputCategoryMask: true) give a hard 0 or 1 per pixel. The edges around hair and shoulders come out jagged, and a blur can't fix that because the information is already gone.

Confidence masks (outputConfidenceMasks: true) give a 0–1 probability per pixel, which unlocks a proper edge pipeline:

// 1. Smoothstep contrast: push clear pixels toward opaque/transparent,
//    keep the uncertain ~0.5 band soft
const s = v * v * (3 - 2 * v);

// 2. Erode ~1px inward to kill background-colour fringing (3x3 min-filter)
// 3. Feather with a small separable box blur for a smooth edge
Enter fullscreen mode Exit fullscreen mode

Same model, much better edges, because you keep the model's uncertainty instead of throwing it away early.

Gotcha: don't hardcode confidenceMasks[1]. Some models return background and foreground channels, others return a single foreground channel. Check the array length. Also wrap model creation so a GPU delegate failure falls back to CPU instead of crashing.

Rule 3: Replace generative AI with older techniques where you can

Tools like Photoshop's Generative Fill use large diffusion models. You can't run those for free in a static page, and you shouldn't send private photos to a server just for a magic eraser.

APIC Studio's Remove Object uses exemplar-based texture synthesis:

  1. Take the painted region plus a padded area of real surrounding pixels.
  2. Split the hole into 8×8 blocks and fill them boundary-inward. The block with the most known neighbours goes first.
  3. For each block, search nearby valid texture for the patch that minimises SSD (sum of squared differences) against the known pixels.
  4. Copy real pixels, not an average. That keeps the result sharp instead of blurry.

A bug worth knowing about: after background removal, transparent pixels still hold leftover RGB values under alpha: 0. A naive "is this pixel painted?" check treats them as valid source texture, and you get background colour pasted into your subject.

The fix is two separate arrays:

  • isPainted defines the hole
  • validSrc marks pixels that are opaque and unpainted, the only ones safe to copy from

Search only a padded bounding box around the mask and adapt the sampling stride to the hole size. Typical fills then finish in well under a second.

Rule 4: Keep drawing non-destructive

APIC Studio's Draw tab (pen, highlighter, eraser, arrows, shapes) follows three principles:

  • Store operations, not pixels. Every stroke is saved in photo coordinates, so undo, redo and clear are cheap and drawings stay sharp at any zoom.
  • A separate layer. The eraser removes only your drawing, never the photo underneath.
  • One arrow = one filled polygon. A line plus two head lines with transparency looks darker where they overlap, and a single path avoids that.

Pointer events with coalesced input keep fast finger and stylus strokes smooth.

Rule 5: Design for the devices people actually own

Privacy-first only matters if the tool runs on real devices. Local processing uses the user's RAM, so:

  • Cap canvas resolution by device: higher on desktop, lower on phones, lowest on low-memory devices
  • Use one pointer-events code path for touch, mouse and stylus
  • Offer a "make photo bigger" toggle on small screens

Rule 6: Make the privacy claim verifiable

"We respect your privacy" is just marketing. Let people check:

  1. Open your browser DevTools and go to the Network tab.
  2. Load an image into the editor and run an edit.
  3. Confirm no request carries your image data.

Opening your tool to that check is the strongest trust signal you can give.

What APIC Studio includes

All free, in the browser, nothing to install:

  • Edit and advanced colour tools
  • Draw
  • Remove Object
  • AI Remove Background
  • Resize and social presets
  • Convert (PNG, JPEG, WebP, PDF and more)
  • Compress to a target size
  • Layers

Try it: apic-studio.vercel.app

FAQ

Is APIC Studio really free?
Yes, and no sign-up is needed to edit.

Does it upload my photos?
No. Processing happens on your device. You can verify this in your browser's Network tab.

Does it need a powerful computer?
No. It's designed for low-end phones and older laptops too.

Is there a desktop version?
Yes. A Windows desktop build is on the GitHub repo.

Takeaways

  • Decide on "no uploads" before you write any code.
  • Keep soft confidence masks until the final compositing step.
  • You don't always need generative AI. Older techniques often fit browser constraints better.
  • Separate "transparent" from "safe to sample from."
  • Let users verify your privacy claims.

I'm a solo developer, and feedback, especially edge cases that break it, helps a lot. If you'd like to support the project, you can follow me on GitHub.

Built by Akhouri Anmol Kumar at Akhouri Systems.

Top comments (28)

Collapse
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

@effessdev bro remember our yesterday plan?
I've started, let's start plan.
APIC STUDIO will shine in the market.

Collapse
 
effessdev profile image
EffessDev •

This is not what I meant when I said "How-to tutorials" but ok 👍

Collapse
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

yeah yeah then? bro post in your profile too pls and tomorrow you with akhouri systems org and me no post, then in 4 december I'll post in my profile and org too and you in your profile understood?

Thread Thread
 
effessdev profile image
EffessDev •

Bro today I got a little bit busy 😅 Can I do it later please... 🥺🙏

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

okay but I just want to remind: you no, me no what's current situtation.
so pls whenever you feel free use that time for akhouri systems
as we're not working for a established company, we're working for a company which needs to be stabilized resulting in making us a established too.
when we became that, we can afford to have 1 day, 2 day leave for sure even I'll take but for now this is a startup, APIC STUDIO needs SEO, Akhouri Systems needs reach, so, you'll at least online today or not?

Thread Thread
 
effessdev profile image
EffessDev •

Ok bro just today only... 🙏 And if I get time I'll write the post today itself!

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

okay so online at least or not?

Thread Thread
 
effessdev profile image
EffessDev •

👍

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

Bro so what're you doing now?
like me finishing APIC V2(bugs are many, fixes are none) lol
also me adding select feature in apic studio otherwise my CTO will kill me lol
so what's your plans(if it is private then say in discord)

Thread Thread
 
effessdev profile image
EffessDev •

Ok select feature is the next step 👍

Bro before adding features, you should decide what to add ok? Don't just add features without thinking (like you did with the layers)...

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

Okay, bro
bro what I did with layers 😆

Thread Thread
 
effessdev profile image
EffessDev •

🤦‍♂️🤣

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

bro can you talk to nyaoamaru please please

Thread Thread
 
effessdev profile image
EffessDev •

what? why?

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

for CXO bro please I talked to him now you as CTO please hehe bro please you are adult and he is too so you'll talk more professionally diplomatically

Thread Thread
 
effessdev profile image
EffessDev •

so I should ask him whether he could become our CXO?

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

I've asked, you talk bro

Thread Thread
 
effessdev profile image
EffessDev •

what did he say when you asked? 🤔 he offered to integrate changelog-bot for ReptClip for free! I don't want to ruin that 🙃

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

bro he said I will thought of, bro please talk and it will not ruin anything lol please
for CXO no one is better than him also after you talk to him come discord. or make him come discord too

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

@effessdev come discord.

Thread Thread
 
effessdev profile image
EffessDev • • Edited

Can you say

  1. What is his job as CXO (exactly)?
  2. How much time will he need to spare every day?
Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

can we discuss in discord these stuffs?

Thread Thread
 
effessdev profile image
EffessDev •

Ok ok 👍

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

Keeping the confidence mask as a 0 to 1 range instead of a hard 0 or 1 is the difference. The hard mask throws the edge information away before the blur ever runs, the soft one keeps the uncertainty until the final step.

Collapse
 
bpecha14 profile image
Bogdan •

Love this approach! Local processing is a game-changer for user trust. I built a similar privacy-first feature for my civic-tech project: we scan purchase histories (CSV files) locally in the browser to look for hidden refunds, ensuring no sensitive financial data ever touches the server. It requires more frontend work, but the user trust is absolutely worth it. Great write-up!

Collapse
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

Thanks in old days privacy was a architecture now days it's a feature 😆 🤣

Collapse
 
ascendra_ventures_92c21f2 profile image
Ascendra Ventures •

Treating "no upload" as an architecture decision rather than a setting is the right way to put it. Once the pipeline starts with a request to an upload route, every later privacy promise depends on the server behaving, while a browser-only design leaves the server nothing to leak. Keeping the confidence mask instead of the hard category mask follows the same idea: hold on to the raw information until the last step.

Ascendra Ventures made a similar choice on a small product, a web dashboard for Actofit body-composition scales, built because the official app stopped returning the full readout while the hardware still worked. It reads the scale directly over Web Bluetooth in the browser, with no app install and no cloud middleman. The scale only sends two raw numbers, weight and bioelectrical impedance, and the app recomputes BMI, body fat and skeletal lean mass from the user's profile using the openScale/Xiaomi body-composition model. A useful side effect is that the derived numbers are never a black box: they come from two readings and the user's own profile.

How do you plan to let users check the claim for themselves? A short note on opening the browser's network tab while editing might be more convincing than a badge, which seems to be what Jan was suggesting.

Collapse
 
jan_sytze profile image
Jan Sytze Heegstra •

Letting users verify the privacy claim themselves is stronger than any badge. Where does APIC Studio slow down first on an older laptop, the masks or the final compositing? If edge cases are what you are after, I run TestMyBuild, where builders try each other's apps and write down what broke: testmybuild.app