Framework for building images from rects and circles.
This project contains framework itself, and demo api and web app
(core and img folder)
I built this framework as much from scratch as i could. I build shapes pixel by pixel in my own canvas implementation. I handle png building myself, exept for compression algorithm part (i use external create for that). I also used extenral create in text generation to decode font glyphs.
- drawing circles and rects
- drawing these shapes rouned
- drawing only outlines of shapes
- filling outlines with different colors
- drawing text
Built with rust and these libs:
- ab_glyph - decoding fonts
- crc32fast - png checksums
- flate2 - compression algorithm
(demo folder)
In this folder there is simple code that generates a few images to output folder. Nothing more nothing less.
(api and web folder)
- simple landing page with links to demo and github
- live demo with image creating with blocks
- downloading generated images
- generating all whats possible using imagen framework
You can view all the enpoints that this api has here
I built this project's frontend partialy with shadcn components
You can host it by yourself with docker!
If you want to use something different than traefik, you need to adjust compose file for your needs.
Dependencies:
docker-compose up -dDependencies:
Run:
web
cd web/
pnpm i
pnpm devevapi
cd api/
cargo runncaddy - mixing api and web together on one port
caddy run