File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 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
33Clojure2D 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
5252Add 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
Original file line number Diff line number Diff line change 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; ;
You can’t perform that action at this time.
0 commit comments