Skip to content
librazPublic

Repository files navigation

nitra

CI License TypeScript React Platform Demo

nitra applies phone-camera retouching after the shot, to a photo you already have, without it leaving your device. It runs entirely in the browser on WebGL2: there is no server, nothing is uploaded, and the face-analysis models are served by the app itself.

Open nitra · Documentation · Getting started

Status — pre-1.0. The recipe format is versioned; the rest of the interface may still change.

What it does

  • Opens and grades — JPEG, PNG, WebP, AVIF and HEIC, worked on in linear Display-P3 at 16 bits per channel; exposure, contrast, highlights and shadows, white balance, saturation as Oklch chroma, per-colour hue/saturation/lightness and finishing effects. Grading
  • Retouches the person — skin, eyes, lips, teeth, cheeks, hair, the background behind them, one added light, and the shape of the face within a bound it measures and shows. Retouching a person
  • Removes blemishes and reflections — fills a blemish from the skin around it, and blurs a bystander caught in a catchlight, mirror or glass inside a circle you place. Blemishes and reflections
  • Puts a face back after an AI edit — restores the photographed face from the original into a picture a generative edit redrew. Restoring a face
  • Frames and captions — flips, turns, straightening, crops sized for Instagram, X, Facebook, YouTube and TikTok, and text in any typeface on your machine. Framing and text
  • Splits across a grid — cuts one picture into profile-grid tiles named in the order they must be uploaded. Grid split
  • Controls metadata — removes it on every export by default, or keeps or writes it field by field; the file carries exactly what the panel lists. Metadata
  • Shows its work — a starting grade suggested from the photo, finishes as thumbnails of your own picture, measurements of texture kept and how far the face moved, magnification to one screen pixel per file pixel, Simple and Detail modes, English and Japanese, light and dark. Interface

Edits are non-destructive: the source is never modified, every amount is relative to the image, and an export is never enlarged. The edit lives only in the tab; what you keep is the exported file.

Getting started

Nothing needs installing to use it: nitra.libraz.net serves the same build this repository produces. Open a photo, adjust it, export.

To run it locally or work on it:

bun install
bun run dev        # http://localhost:5173

The first run downloads the face-analysis models into public/models (about forty megabytes, pinned by digest, not committed). Without them the app still runs and the face controls say the analysis is unavailable. A browser with WebGL2 and half-float render targets is required: current Chrome, Edge, Safari or Firefox.

bun run check      # lint and format
bun run typecheck
bun run test
bun run build      # static files in dist/, ready for any static host

Documentation

Non-goals

nitra retouches; it does not make someone look like a different person. Rebuilding bone structure, swapping faces, reshaping a body, filling in generatively and replacing the background are out of scope. Blurring a reflection is not erasure, and nitra makes no claim about what could be recovered from the file. There is no server, no upload path and no accounts, and none will be added. Video is out of scope for now. See Introduction for the reasons.

License

AGPL-3.0

Releases

Packages

Contributors

Languages