Skip to content

Commit bc2628b

Browse files
committed
readme updated
1 parent e83ab36 commit bc2628b

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# clojure2d [![Build Status](https://travis-ci.org/Clojure2D/clojure2d.svg?branch=master)](https://travis-ci.org/Clojure2D/clojure2d)
1+
# clojure2d [![Build Status](https://travis-ci.org/Clojure2D/clojure2d.svg?branch=master)](https://travis-ci.org/Clojure2D/clojure2d) [![Clojars Project](https://img.shields.io/clojars/v/clojure2d.svg)](https://clojars.org/clojure2d)
22

33
Clojure2D is a library supporting generative coding or glitching. It's based on Java2D directly. It's Clojure only, no ClojureScript version.
44

@@ -51,11 +51,7 @@ There are still plenty of bugs and not idiomatic code. It may be slower than Pro
5151

5252
Add following line as a dependency to your `project.clj`
5353

54-
Development version (release soon):
55-
56-
```clojure
57-
[clojure2d "1.0.1"]
58-
```
54+
![](https://clojars.org/clojure2d/latest-version.svg)
5955

6056
## Usage
6157

generateme/colors.clj

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,24 @@
2727

2828
(def img (p/load-pixels "docs/samurai.jpg"))
2929

30-
(u/show-palette (c/reduce-colors :LUV (resize (p/load-pixels "bbb1.jpg") 600 600) 5) )
30+
(let [img (p/load-pixels "aaa1.jpg")
31+
ratio (/ 1.0 (max (width img) (height img)))
32+
ns 600.0
33+
cls 6
34+
nw (* ratio ns (width img))
35+
nh (* ratio ns (height img))
36+
pal (c/reduce-colors :LUV (->> (resize img nw nh)
37+
;; (p/filter-channels p/median)
38+
) cls)]
39+
(println nw nh)
40+
(u/show-palette pal)
41+
(u/show-gradient (c/gradient :LAB :cubic-spline pal))
42+
)
3143

3244
;;
3345

3446
(save (:buffer (u/show-gradient (c/gradient :LAB :cubic-spline (c/reduce-colors :LAB (resize (p/load-pixels "b5.jpg") 600 600) 5)))) "b5grad.jpg")
3547

36-
(u/show-gradient (c/gradient :LAB :cubic-spline (c/reduce-colors :LUV (resize (p/load-pixels "bbb1.jpg") 600 600) 4)))
48+
(u/show-gradient (c/gradient :LAB :cubic-spline (c/reduce-colors :LAB (p/filter-channels p/median (resize img 600 600)) 4)))
3749

3850
;;

0 commit comments

Comments
 (0)