Note
What if you could share photos using just a URL โ no server, no cloud, no internet required?
NanoGlyph is an offline-first Progressive Web App (PWA) that encodes images into compact, URL-safe text. Share images via messaging apps on restrictive WiFi networks, air-gapped environments, or anywhere traditional image sharing fails.
The idea came from a real frustration: restrictive WiFi networks (airports, hotels, corporate) that block image uploads but allow text messages. What if the image was the message?
NanoGlyph solves this by:
- Encoding any image into a compact Base62 string
- Embedding it directly in the URL fragment (
#...) - Decoding it entirely in-browser โ no server ever sees the data
The entire image lives in the link. Send it via WhatsApp, Telegram, SMS, email โ anything that can carry text.
| Feature | Description |
|---|---|
| ๐จ 99 Color Palettes | 20 hand-crafted + 79 procedural palettes with Auto/Manual toggle |
| ๐๏ธ Instant Adjustments | Saturation, Hue, Exposure, Contrast, and Temperature calculated instantly in WebAssembly |
| ๐ Aggressive PWA | Custom Service Worker bypasses "stuck cache" bugs standard to mobile PWAs for guaranteed updates |
| ๐ฑ Platform-Aware Chunking | Auto-splits URLs for WhatsApp (4K), Telegram (4K), Messenger (2K), Instagram (1K) |
| ๐ผ๏ธ Multi-Format Support | PNG, JPEG, GIF, WebP, BMP, HEIF/HEIC โ including animations |
| ๐พ Save as PNG | Download received images directly to your gallery with one tap |
| ๐ Zero Server | Everything runs in your browser via WebAssembly โ no data leaves your device |
| ๐ถ Offline-First | Works without internet after first visit โ self-contained ImageSession Wasm layer |
| โก Rust + WebAssembly | Image processing at near-native speed using Bayer dithering and RLE |
| ๐๏ธ Dual Compression | Choose between Brotli (maximum compression) or Zlib (compatibility) |
| ๐๏ธ Quality Control | Low (64px) to Cosmic (2048px) โ you choose the tradeoff |
flowchart LR
A["๐ผ๏ธ Image\n(Upload)"] --> B["๐ Resize & Cache\n(ImageSession)"]
B --> C["๐๏ธ Pixel Adjustments\n(Hue, Saturation...)"]
C --> D["๐จ Auto-Palette & \nBayer Dithering"]
D --> E["๐ฆ Pack\n3-bit/px"]
E --> F["๐๏ธ RLE\nEncode"]
F --> G["๐จ Brotli/Zlib\nCompress"]
G --> H["๐ค Base62\nEncode"]
H --> I["๐ URL\nFragment #..."]
flowchart LR
A["๐ URL\nFragment #..."] --> B["๐ค Base62\nDecode"]
B --> C["๐จ Brotli/Zlib\nDecompress"]
C --> D["๐๏ธ RLE\nDecode"]
D --> E["๐ฆ Unpack\n3-bit/px"]
E --> F["๐จ Palette\nLookup"]
F --> G["๐ผ๏ธ Canvas\nRender"]
G --> H["๐พ Save\nas PNG"]
Step by step:
- Resize โ Scale to target dimension (64โ2048px) and cache in WebAssembly RAM
- Adjust โ Apply Exposure, Contrast, Saturation, Hue, and Temperature mathematically
- Palette โ Auto-detect or manually lock one of 99 palettes (8 colors each)
- Dither โ Bayer ordered dithering for smooth color transitions
- Pack โ 3 bits per pixel (8 colors = 3 bits, 62% size reduction vs 8-bit)
- RLE โ Run-length encoding for repeated color runs
- Compress โ Brotli (Q11) or Zlib (L9) for maximum entropy compression
- Base62 โ URL-safe encoding using
A-Za-z0-9only
The result is a self-contained URL like:
https://ghagui.github.io/NanoGlyph-Share/#2s54FcFnAlWr...
- Rust โ Core image processing, compression, and Base62 encoding
- WebAssembly โ Compiled from Rust via
wasm-packfor browser execution - Vanilla JS/CSS/HTML โ Zero-dependency frontend, no frameworks
- Service Worker โ Offline caching for PWA support
- GitHub Actions โ CI/CD pipeline builds Wasm and deploys to GitHub Pages
cd nanoglyph_core
wasm-pack build --target web# From the project root
python3 -m http.server 8080
# Open http://localhost:8080| Source | Quality | Palette | Chunks (WhatsApp) | URL Length |
|---|---|---|---|---|
| Photo (1080p) | Medium (128px) | Auto | 1 | ~8,000 chars |
| Photo (1080p) | High (192px) | Auto | 5 | ~18,000 chars |
| Photo (1080p) | Extreme (256px) | Auto | 7 | ~28,000 chars |
| Icon (64x64) | Low (64px) | Auto | 1 | ~800 chars |
NanoGlyph includes 99 palettes:
- #0 โ Default (RGB primaries)
- #1 โ Classic CGA
- #2 โ Real Photography Colors
- #3-#20 โ Themed (Portraits, Cinema, Vintage, Cyberpunk, Food, etc.)
- #21-#98 โ Procedural (full 360ยฐ hue spectrum)
Each palette contains 8 colors, and the encoder automatically selects the best-matching palette for your image.
Important
Messaging apps auto-hyperlink URLs only up to a certain length. Beyond that, the URL is sent as plain text โ the receiver must manually copy-paste it into the browser.
| Platform | Clickable Link Limit | Auto-Chunk |
|---|---|---|
| ~4,096 chars | โ | |
| Telegram | ~4,096 chars | โ |
| Messenger | ~2,000 chars | โ |
| ~1,000 chars | โ |
NanoGlyph chunks based on the clickable limit so every shared part is a tappable link.
(MIT โ Use it, fork it, share images without the cloud.)[./LICENSE]
โค๏ธ Made by Gabriel Hagui in Rust