phosphor-cam
llms.txt167 starsChanged 3 months agoMITView on GitHub
Canonical site: https://phosphor.aroy.site/ Source: https://github.com/pshycodr/phosphor-cam Version documented: 1.4.0 License: MIT Author: Anish Roy (Pshycodr) Last updated: 2026-11-20 Phosphor Cam is a client-side camera and photo studio that turns a live webcam feed or a still image into stylized character, dot, block, or line art. It runs in the browser, installs as a PWA, and ships as a native Android app built from the same codebase. The camera surface is at /. The photo editor, Phosphor Studio, starts at /studio. Both…
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- public/llms.txtllms.txt
The file
We split this llms-full.txt into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
All five engines run through the same renderer interface.
- Very specific: line 120
Default settings are ASCII mode, the standard character set, 10 px characters, 1.2× contrast, 0 brightness, green (#00ff00) on black …
- Distinctive: line 202
Every renderer, photo capture, recording, and copied ASCII sample uses the same cropped canvas, so the saved result matches the preview.
≈ “Common” is an estimate: at least 1 in 5 of the 4,067 llms.txt files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
# Phosphor Cam — Full Documentation
Canonical site: https://phosphor.aroy.site/
Source: https://github.com/pshycodr/phosphor-cam
Version documented: 1.4.0
License: MIT
Author: Anish Roy (Pshycodr)
Last updated: 2026-11-20
## 1. Overview
Phosphor Cam is a client-side camera and photo studio that turns a live webcam feed or a still image into stylized character, dot, block, or line art. It runs in the browser, installs as a PWA, and ships as a native Android app built from the same codebase.
The camera surface is at `/`. The photo editor, Phosphor Studio, starts at `/studio`. Both surfaces use the same five render engines, settings model, and effect pipeline, so a look tuned on the live camera can be reproduced on a photo.
Rendering happens on the device with Canvas 2D and Web Workers. Camera frames and photos are not uploaded, and the app has no account system or media upload endpoint.
## 2. Routes and surfaces
- `/` — live camera, settings, capture, and video recording.
- `/studio` — Studio empty state: file picker, drag-and-drop zone, clipboard paste, and three sample images.
- `/studio/edit` — Studio editor. This route requires a loaded image; opening it directly redirects to `/studio`. It is an application state rather than a standalone landing page.
The web app is a single-page React application. The Studio editor route is lazy-loaded so the empty Studio screen does not load the canvas worker.
## 3. Render engines
All five engines run through the same renderer interface. Character size controls the output cell size; smaller cells produce finer detail at a higher processing cost.
### ASCII
Maps each source pixel's luminance to a character from the selected character set. The character ramp runs from dark to light, and `invert` swaps the direction.
- Optional color mode draws each character in the source pixel's true RGB color.
- Monochrome mode uses the configured foreground and background colors.
- The ASCII renderer can also produce plain text at a fixed width of 150 characters for clipboard copy.
### Dither
Uses Floyd–Steinberg error diffusion. Each pixel is quantized to the nearest available output value, and the quantization error is distributed to neighboring pixels with the standard 7/16, 3/16, 5/16, 1/16 weights.
- Monochrome mode dithers luminance and maps the result to the foreground/background palette.
- Color mode dithers the red, green, and blue channels independently and draws the resulting RGB values.
- Output is upscaled with nearest-neighbor sampling for crisp blocks.
### Halftone
Recreates the image as a grid of dots whose size encodes brightness, similar to a printed halftone screen.
- Brightness is mapped to one of 64 dot levels; level 0 draws no dot.
- Odd rows are shifted by half a cell to form a brick pattern and break up vertical seams.
- Monochrome mode tints the dot atlas with the foreground color.
- Color mode draws the dots as an alpha mask and paints the source frame through it, preserving per-dot color.
- `invert` swaps the dot mapping and the foreground/background colors for a true negative.
### Voxel
Quantizes the image into solid color blocks.
- Flat mode draws one block per cell with a single ImageData blit and nearest-neighbor upscale.
- 3D mode draws raised cubes with top, right, and bottom faces from a pre-rendered sprite atlas.
- Monochrome mode builds a 16-step color ramp between the background and foreground colors.
- Color mode uses a fixed 22-color palette.
- A 4×4 Bayer ordered-dither offset is applied before palette lookup to reduce banding.
- `invert` inverts the RGB channels before palette lookup, producing a full negative.
### Lines
Renders each row or column as one continuous ribbon whose thickness follows source luminance.
- `lineDirection` selects horizontal or vertical ribbons.
- Edges are Catmull-Rom splines converted to Bézier curves, so the ribbon flows instead of stepping between samples.
- Monochrome mode fills the ribbon with the foreground color.
- Color mode paints each cell with its true source RGB.
- Minimum and maximum ribbon thickness are derived from the cell size.
## 4. ASCII character sets
There are 22 character sets. The leading space in most sets represents the darkest level.
```text
standard " .:-=+*#%@MB"
simple " .+#@"
blocks " ░▒▓█"
matrix " 01"
edges " .,-_~:;=!*#$@"
dense " .`^",:;Il!i~+_-?][}{1)(|\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$"
lines " ─│┌┐└┘├┤┬┴┼"
heavyLines " ═║╔╗╚╝╠╣╦╩╬"
invertedBlocks " █▓▒░ "
braille " ⠁⠃⠇⡇⣇⣧⣷⣿"
dots " .•◦●◉"
circles " .oO◌◎●"
spark " .`'^*✦✧✶✹"
tech " .:+=xX$#"
digital " .:-=+*#%@"
alphabetic " .abcdefghijklmnopqrstuvwxyz"
upperAlpha " .ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numeric " 0123456789"
mixed " .:-=+*#%@abcdefghijklmnopqrstuvwxyz"
arrows " .<>^v"
binaryDense " 01#@"
runic " .ᚠᚢᚦᚨᚱᚲᚷᚹ"
```
## 5. Adjustments and appearance
- Character size: 2–30 px.
- Contrast: 0.5×–3.0×.
- Brightness: −100 to +100.
- Color mode: draws source colors instead of a fixed palette.
- Invert: swaps light and dark handling.
- Foreground and background: any hex color.
- Color controls: H/S/B sliders, hex input, six presets, random foreground/background, and a foreground/background swap.
- Six color presets: Matrix (`#00ff00` on `#000000`), Amber (`#ffb000` on `#000000`), Cyan (`#00e5ff` on `#000000`), Paper (`#1a1a1a` on `#f5f5f0`), Neon Pink (`#ff2e88` on `#0a0014`), and Blood (`#ff1a1a` on `#0a0000`).
- Voxel 3D mode: toggles flat blocks versus raised cubes.
- Line direction: horizontal or vertical.
- On phones, the camera frame can be set to 1:1, 3:4, or full screen. The default is 3:4. Desktop uses the available stage.
Default settings are ASCII mode, the standard character set, 10 px characters, 1.2× contrast, 0 brightness, green (`#00ff00`) on black (`#000000`), 3D voxels enabled, 4× capture scale, 3:4 aspect ratio, horizontal lines, all effects off, and PNG capture.
## 6. Effects
Seven optional passes are available. Each has an on/off state and an intensity value. Effects apply to the live preview, saved images, and exports.
The pipeline runs in this order:
1. Chromatic aberration
2. Glow
3. Bloom
4. Halation
5. Vignette
6. Scanlines
7. Grain
Behavior:
- **Chromatic aberration** splits the red, green, and blue channels horizontally by up to 8 px at full intensity.
- **Glow** adds a small, soft additive blur with a slight brightness lift.
- **Bloom** adds a wider, brighter additive blur with increased contrast for highlight bleed.
- **Halation** adds a wide, warm orange blur around highlights, simulating film halation.
- **Vignette** darkens the frame radially from the middle toward the corners.
- **Scanlines** overlays a repeating 3 px dark line pattern.
- **Grain** overlays animated 128 px noise tiles with an overlay blend.
## 7. Phosphor Studio
Studio is the photo-editing side of the app. Open it from the Studio button in the camera header or directly at `/studio`.
### Loading images
- Select an image with the file picker.
- Drop an image onto the viewport.
- Paste an image with the Paste button or `Ctrl`/`Cmd` + `V`.
- Choose one of three built-in samples: Clock Tower, Flower, or People sitting.
Studio currently edits images only. Video files show a “Video editing is coming soon” message.
Uploaded images are downscaled before editing to at most 1,600 px on the long edge and to roughly the viewport's pixel budget, with a 640×480 floor. Previews and exports then process the same bounded source.
### Presets
There are ten presets in three categories.
| Preset | Category | What it does |
| --- | --- | --- |
| Phosphor CRT | Retro CRT | Green ASCII terminal look with standard characters, glow, vignette, and scanlines. |
| Amber Terminal | Retro CRT | Warm amber ASCII look with bloom, halation, vignette, scanlines, and grain. |
| Matrix Rain | Retro CRT | High-contrast green ASCII using the `matrix` (`0`/`1`) set, with glow, chromatic aberration, vignette, scanlines, and grain. |
| Cyberpunk 2077 | Print & Dither | Color dither with a neon magenta accent, glow, chromatic aberration, vignette, scanlines, and grain. |
| Newspaper Print | Print & Dither | Monochrome Floyd–Steinberg dither with dark ink on off-white paper, vignette, and grain. |
| Cyan Halftone | Print & Dither | Cyan halftone dots on a deep blue-black background with glow and vignette. |
| Pop Art Halftone | Print & Dither | Full-color halftone dots with halation, vignette, and grain. |
| Broadcast Lines | Digital & 3D | Horizontal luminance ribbons in teal on near-black, with chromatic aberration, vignette, and scanlines. |
| Architectural Blueprint | Digital & 3D | Vertical white line hatching on blueprint blue, with vignette and grain. |
| 8-Bit Voxels | Digital & 3D | Color 3D voxel cubes at 12 px with vignette. |
### Editing
- The inspector is a 344 px right rail on desktop and a persistent bottom sheet below 1024 px.
- Zoom ranges from 0.5× to 4×. Mouse wheel and pinch zoom; double-click toggles 2× and reset; pan when zoomed in.
- Hold the Compare button to crossfade to the original photo.
- Undo and redo cover adjustments, presets, and color changes. History holds up to 30 entries.
- Reset restores the default settings.
- Keyboard shortcuts: `Ctrl`/`Cmd` + `Z` undo, `Ctrl`/`Cmd` + `Shift` + `Z` or `Ctrl` + `Y` redo, `Esc` closes the export dialog.
- On touch screens, a horizontal swipe at 1× zoom steps through the render engines.
- Leaving the editor with unsaved changes opens a discard confirmation. Android back follows the same flow.
### Export
- Formats: PNG, JPEG, and WEBP.
- Scale: 1×–20×. Above 12× the interface warns that large canvases may take longer or fail.
- Save image downloads the render.
- Copy image copies a PNG render to the clipboard.
- Copy ASCII is available when the ASCII renderer is active and copies plain text.
## 8. Camera
- Requests video-only camera access with an ideal resolution of 1920×1080; audio is not requested.
- Front and back camera switching. The front-camera preview is mirrored.
- The viewfinder center-crops the stream to the selected aspect ratio; the crop is mirrored after cropping, so people and objects keep their shape.
- Every renderer, photo capture, recording, and copied ASCII sample uses the same cropped canvas, so the saved result matches the preview.
- The frame size follows the viewfinder stage; the live FPS, render time, and frame size are displayed in the header.
- Photo capture uses the active renderer's high-resolution capture path.
- Video recording captures the rendered canvas with `MediaRecorder` at 30 fps and 2.5 Mbps. It prefers VP9 WebM, then VP8 WebM, H.264 MP4, WebM, and MP4.
- Copy ASCII is available only for the ASCII renderer.
- Settings open as a 360 px right rail on desktop and a bottom drawer on phones. `Esc` closes the desktop rail.
- Phone gestures: horizontal swipe steps the renderer, upward swipe opens settings, downward swipe closes them, pinch steps the aspect ratio, and double-tap flips the camera. Renderer, pinch, and flip gestures are disabled while recording or while the settings editor is open.
## 9. Capture, recording, and export
- Camera snapshot: uses the active renderer's capture path and the configured capture scale for ASCII, Dither, Halftone, and Voxel. Lines uses a fixed 4× capture scale.
- Camera recording: records the rendered canvas, not the raw camera stream, so effects and the selected engine are included.
- Studio export: renders the bounded source image at the selected format and scale.
- Clipboard: rendered images can be copied in Studio; ASCII text can be copied in both the camera and Studio.
- Capture scale: 1×–20×, with a warning above 12×.
## 10. Performance and architecture
- Rendering runs in a Web Worker using Canvas 2D and OffscreenCanvas, keeping the interface responsive while frames are processed.
- The camera pipeline targets 60 FPS; actual FPS depends on the device, renderer, character size, effects, and frame size.
- Settings are shared between the camera and Studio through a Zustand store. The Studio editor has its own history stack.
- The Studio editor route is lazy-loaded, so the empty Studio screen does not ship the canvas worker.
- The PWA registers a service worker in production. Navigation uses network-first caching; other assets use stale-while-revalidate. The Android build is fully offline after install.
## 11. Privacy and security
- Camera frames, photos, and renders are processed locally and are not uploaded.
- There is no account system, cloud sync, or server-side media processing.
- Camera access requires a secure context: HTTPS or `localhost`.
- The project does not publish a dedicated security email. The repository issue tracker is the only published contact channel.
## 12. Browser support
Requires `getUserMedia`, Canvas 2D, and ES2020+.
| Browser | Version |
| --- | --- |
| Chrome | 90+ |
| Firefox | 88+ |
| Safari | 14+ |
| Edge | 90+ |
The interface is responsive down to 360 px wide. Touch targets are at least 44 px on mobile, and reduced-motion and reduced-transparency preferences are respected.
## 13. PWA and Android
- The web app is installable as a PWA with a standalone display, a dark theme (`#080908`), and 192 px and 512 px icons.
- The Android build uses Capacitor with application ID `site.aroy.phosphor` and is built from the same source.
- Android releases are signed and published automatically. The app works offline after install.
- On Android, saved images and videos are written to `Documents/Phosphor-cam/images` and `Documents/Phosphor-cam/videos`.
- The Android app handles the system back gesture, including the Studio discard flow and exit hint.
## 14. Technology stack
At version 1.4.0:
- React 19.2.5 and React DOM 19.2.5
- TypeScript 6.0
- Vite 8
- Tailwind CSS 4.2
- Zustand 5
- React Router 8
- Capacitor 8
- Vaul 1.1
- Lucide React and React Icons
- react-hot-toast
- Canvas 2D, Web Workers, OffscreenCanvas
- MediaStream API and MediaRecorder
- Bun 1.4.0 for development and builds
The app is a static Vite build deployed to Cloudflare Pages. There is no application server.
## 15. Limitations and roadmap
- Studio supports images only. Video editing is planned for a later release.
- Camera access requires permission and a secure context.
- Large capture scales above 12× may be slow or fail on devices with limited canvas memory.
- Lines captures at a fixed 4× scale rather than the configurable 1×–20× scale.
- Browser support is limited to browsers with `getUserMedia`, Canvas 2D, and ES2020+.
- There is no account, cloud storage, or cross-device sync.
## 16. Project and license
- Author: Anish Roy (Pshycodr)
- Repository: https://github.com/pshycodr/phosphor-cam
- License: MIT, copyright (c) 2025 Anish Roy
- Contributing guide: https://github.com/pshycodr/phosphor-cam/blob/main/CONTRIBUTING.md
- Issues: https://github.com/pshycodr/phosphor-cam/issues
- Latest Android release: https://github.com/pshycodr/phosphor-cam/releases/latest
- F-Droid: https://f-droid.org/packages/site.aroy.phosphor/
## 17. Links
- [Phosphor Cam](https://phosphor.aroy.site/)
- [Phosphor Studio](https://phosphor.aroy.site/studio)
- [Source code](https://github.com/pshycodr/phosphor-cam)
- [README](https://github.com/pshycodr/phosphor-cam/blob/main/README.md)
- [Contributing](https://github.com/pshycodr/phosphor-cam/blob/main/CONTRIBUTING.md)
- [License](https://github.com/pshycodr/phosphor-cam/blob/main/LICENSE)
- [Android releases](https://github.com/pshycodr/phosphor-cam/releases/latest)
- [F-Droid listing](https://f-droid.org/packages/site.aroy.phosphor/)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

