https://github.com/friendlymatthew/norm
Image editor from scratch. Includes a TrueType font parser and PNG encoder/decoder.
https://github.com/friendlymatthew/norm
image image-processing truetype-font wgpu
Last synced: 8 months ago
JSON representation
Image editor from scratch. Includes a TrueType font parser and PNG encoder/decoder.
- Host: GitHub
- URL: https://github.com/friendlymatthew/norm
- Owner: friendlymatthew
- License: mit
- Created: 2024-12-07T20:15:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-22T02:25:55.000Z (8 months ago)
- Last Synced: 2025-10-22T04:16:16.091Z (8 months ago)
- Topics: image, image-processing, truetype-font, wgpu
- Language: Rust
- Homepage: https://crates.io/crates/normeditor
- Size: 82.6 MB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# norm
A PNG editor from scratch (well, as close to scratch as possible).
As a decoder, this project uses the [PNG test suite](http://www.schaik.com/pngsuite/) to validate its ability to handle
various PNG features and edge cases. Currently, norm can decode and render images with an 8-bit color depth.
The renderer supports various image processing features on the GPU.
## Usage
Run `cargo run --release `. For example:
```bash
cargo r --release ./tests/obama.png
```
### Additional Scripts
```bash
# Run the renderer with an experimental camera
cargo r --features camera -- ./tests/obama.png
# Profile the decoder
cargo b --release && samply record ./target/release/norm_decode_png ./tests/reagan.png
# Run ad-hoc benchmarks
cargo r --release --bin norm_decode_png --features time ./tests/Periodic_table_large.png
# Parse and render glyphs from the lato font file
# See the generated `glyph_playground` directory.
cargo r --bin norm_lato_glyphs hfkdp!
# Run the PNG test suite
cargo r --bin norm_png_test_suite
# Fuzz the decoder
./fuzz.sh
```
## Reading
### PNG Specification
https://www.w3.org/TR/2003/REC-PNG-20031110/
http://www.libpng.org/pub/png/pngintro.html
https://www.w3.org/Graphics/PNG/platform.html
https://optipng.sourceforge.net/pngtech/optipng.html
https://optipng.sourceforge.net/pngtech/better-filtering.html
http://www.libpng.org/pub/png/pngpic2.html
https://www.lucaversari.it/FJXL_and_FPNGE.pdf
### GPU Programming
https://sotrh.github.io/learn-wgpu/beginner/tutorial5-textures/
https://raphlinus.github.io/gpu/2020/02/12/gpu-resources.html
### Image Processing
https://www.youtube.com/watch?v=KuXjwB4LzSA
https://www.shadertoy.com/view/4tSyzy
https://www.shadertoy.com/view/wsK3Wt
https://www.cns.nyu.edu/pub/lcv/wang03-preprint.pdf
https://www.cns.nyu.edu/pub/eero/wang03b.pdf
https://ece.uwaterloo.ca/~z70wang/research/ssim/
http://arxiv.org/pdf/2006.13846
### TrueType Font Rendering
https://faultlore.com/blah/text-hates-you/
https://developer.apple.com/fonts/TrueType-Reference-Manual/
https://www.youtube.com/watch?v=SO83KQuuZvg
https://www.microsoft.com/en-us/research/wp-content/uploads/2005/01/p1000-loop.pdf
https://medium.com/@evanwallace/easy-scalable-text-rendering-on-the-gpu-c3f4d782c5ac
### Miscellaneous
https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/