Skip to content

New tool: Remove image background, on the device #44

Closed

Description

@kingrishabdugar

What

A Remove Background tool: add a photo (a person, a product, a signature) and get a PNG with a transparent background, or a plain white or coloured one. Everything runs on the device, and the photo never leaves it.

Why

It's one of the most searched image tasks (passport photos, product shots, profile pictures, signatures for forms). Popular sites upload your photo and limit free use.

Ideas

  • A small segmentation model run in the browser with ONNX Runtime Web (MIT) or TensorFlow.js (Apache-2.0). Portrait or salient-object models such as MODNet or U²-Net-lite are a few MB.
  • The model must be self-hosted under /models/ like the OCR files (see vite-plugins/ocr-assets.ts): the page may only load files from its own origin. It must also be permissively licensed, so please state the model's licence in the proposal.
  • Load the model only when this tool runs, as OCR does, so the rest of the site stays tiny.
  • Nice extras: a before/after slider, a background colour picker (white for forms), and an edge-softness slider.
  • Signature cleanup is a quick first step that needs no model: keep dark ink and make light paper transparent (a threshold slider). It would be very useful for forms.

Steps

  1. Comment with the model and runtime you propose, and their licences and download size.
  2. Add src/engine/background.ts, a tool entry (format: 'image') in src/site.ts, and strings in src/i18n.ts.
  3. Add e2e tests. A simple synthetic image (a dark shape on a light background) is enough to check transparency in the output.

Activity

  1. kingrishabdugar commented on Oct 17, 2026

    @kingrishabdugar
    OwnerAuthor

    This is done and live: https://fizzdoc.com/remove-background/

    It runs fully on your device with BiRefNet-lite (MIT) or U²-Net small (Apache-2.0) for phones, both self-hosted, so the photo never leaves the browser. It works for photos, GIFs (https://fizzdoc.com/remove-gif-background/) and videos (https://fizzdoc.com/remove-video-background/), and there's also a WhatsApp sticker maker (https://fizzdoc.com/whatsapp-sticker-maker/).

    Built in #90 and #92, with shadow, outline, crop, Tap to remove / Tap to keep and sharper edges added in #95–#98. Closing as completed. Thanks to everyone who upvoted it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions