From 209968af33280148a410223bb26e9077f8894970 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Mon, 9 Feb 2026 18:25:15 +0100 Subject: [PATCH] publishing commit --- .gitignore | 1 + Cargo.lock | 2 +- Cargo.toml | 11 +++++++++-- README.md | 14 ++++++++++++++ src/lib.rs | 1 + 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/.gitignore b/.gitignore index 5db355e..d8d017f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target /.direnv *.png +perf.* diff --git a/Cargo.lock b/Cargo.lock index fa18bf3..5762525 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "imgsyn" -version = "0.1.0" +version = "1.0.0" dependencies = [ "png", ] diff --git a/Cargo.toml b/Cargo.toml index 2485187..544d530 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,14 @@ [package] name = "imgsyn" -version = "0.1.0" +description = "Image synthesizer" +license = "MIT" +repository = "https://git.tudbut.de/tudbut/imgsyn" +version = "1.0.0" edition = "2024" [dependencies] -png = "0.18.0" +png = { version = "0.18.0", optional = true } + +[features] +default = ["png"] +png = ["dep:png"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..b0639d8 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# ImgSyn Image Synthesizer + +ImgSyn is an image synthesizer written in rust, capable +of applying layered effects and transformations to a canvas +to produce an image. The image can then be given out as a PNG, +or accessed from rust directly. + +Notably, ImgSyn uses the same model as rust iterators, just for +images. + +![A graph created in ImgSyn](./graph.png) + +See the tests in lib.rs for some examples. + diff --git a/src/lib.rs b/src/lib.rs index 45b5d2a..f37881d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -80,6 +80,7 @@ pub trait ImgSyn: Clone { let painted = self.paint(meta); PaintedCanvas::rgba255(&painted) } + #[cfg(feature = "png")] fn png(self, meta: Canvas) -> Vec { let painted = self.paint(meta); let mut data = Vec::new();