Skip to content

Commit aaaff64

Browse files
committed
reduce-colors to generate palette from images, v1.0.1
1 parent 2bab51a commit aaaff64

File tree

53 files changed

+442
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+442
-385
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log
22
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
33

4+
## 1.0.1
5+
6+
### Added
7+
8+
* `Pixels` can be treated as sequence now (sequence of colors)
9+
* `reduce-colors` using x-means clustering algorithm
10+
411
## 1.0.0
512

613
### Added

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Clojure2D is a library supporting generative coding or glitching. It's based on
1515

1616
## WARNING
1717

18-
Version `1.0.0` is after big refactoring and contains plenty of breaking changes.
18+
Version `1.x.x` is after big refactoring and contains plenty of breaking changes.
1919

2020
## Documentation
2121

@@ -54,7 +54,7 @@ Add following line as a dependency to your `project.clj`
5454
Development version (release soon):
5555

5656
```clojure
57-
[clojure2d "1.0.0"]
57+
[clojure2d "1.0.1"]
5858
```
5959

6060
## Usage

docs/codox/clojure2d.color.html

Lines changed: 189 additions & 188 deletions
Large diffs are not rendered by default.

docs/codox/clojure2d.core.html

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

docs/codox/clojure2d.extra.glitch.html

Lines changed: 116 additions & 92 deletions
Large diffs are not rendered by default.

docs/codox/clojure2d.extra.overlays.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html PUBLIC ""
22
"">
3-
<html><head><meta charset="UTF-8" /><title>clojure2d.extra.overlays documentation</title><script type="text/javascript" async="" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="highlight/solarized-light.css" /><script type="text/javascript" src="highlight/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a> with <a href="https://github.com/xsc/codox-theme-rdash">RDash UI</a> theme</h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Clojure2d</span> <span class="project-version">1.0.0</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>clojure2d</span></div></div></li><li class="depth-2 branch"><a href="clojure2d.color.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>color</span></div></a></li><li class="depth-2 branch"><a href="clojure2d.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>extra</span></div></div></li><li class="depth-3 branch"><a href="clojure2d.extra.glitch.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>glitch</span></div></a></li><li class="depth-3 branch current"><a href="clojure2d.extra.overlays.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>overlays</span></div></a></li><li class="depth-3 branch"><a href="clojure2d.extra.raymarching.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>raymarching</span></div></a></li><li class="depth-3 branch"><a href="clojure2d.extra.segmentation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>segmentation</span></div></a></li><li class="depth-3 branch"><a href="clojure2d.extra.signal.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>signal</span></div></a></li><li class="depth-3"><a href="clojure2d.extra.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="clojure2d.pixels.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>pixels</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-noise-overlay"><div class="inner"><span>noise-overlay</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-render-crt-scanlines"><div class="inner"><span>render-crt-scanlines</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-render-noise"><div class="inner"><span>render-noise</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-render-rgb-scanlines"><div class="inner"><span>render-rgb-scanlines</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-render-spots"><div class="inner"><span>render-spots</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-spots-overlay"><div class="inner"><span>spots-overlay</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">clojure2d.extra.overlays</h1><div class="doc"><div class="markdown"></div><div class="markdown"><h4>Categories</h4><ul></ul><p>Other vars: <a href="clojure2d.extra.overlays.html#var-noise-overlay">noise-overlay</a> <a href="clojure2d.extra.overlays.html#var-render-crt-scanlines">render-crt-scanlines</a> <a href="clojure2d.extra.overlays.html#var-render-noise">render-noise</a> <a href="clojure2d.extra.overlays.html#var-render-rgb-scanlines">render-rgb-scanlines</a> <a href="clojure2d.extra.overlays.html#var-render-spots">render-spots</a> <a href="clojure2d.extra.overlays.html#var-spots-overlay">spots-overlay</a></p></div><div class="markdown"><h4>Code snippets</h4><div><blockquote><p>Save overlays</p></blockquote><pre><code>(defn save-result
3+
<html><head><meta charset="UTF-8" /><title>clojure2d.extra.overlays documentation</title><script type="text/javascript" async="" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="highlight/solarized-light.css" /><script type="text/javascript" src="highlight/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a> with <a href="https://github.com/xsc/codox-theme-rdash">RDash UI</a> theme</h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Clojure2d</span> <span class="project-version">1.0.1</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>clojure2d</span></div></div></li><li class="depth-2 branch"><a href="clojure2d.color.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>color</span></div></a></li><li class="depth-2 branch"><a href="clojure2d.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>extra</span></div></div></li><li class="depth-3 branch"><a href="clojure2d.extra.glitch.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>glitch</span></div></a></li><li class="depth-3 branch current"><a href="clojure2d.extra.overlays.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>overlays</span></div></a></li><li class="depth-3 branch"><a href="clojure2d.extra.raymarching.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>raymarching</span></div></a></li><li class="depth-3 branch"><a href="clojure2d.extra.segmentation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>segmentation</span></div></a></li><li class="depth-3 branch"><a href="clojure2d.extra.signal.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>signal</span></div></a></li><li class="depth-3"><a href="clojure2d.extra.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="clojure2d.pixels.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>pixels</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-noise-overlay"><div class="inner"><span>noise-overlay</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-render-crt-scanlines"><div class="inner"><span>render-crt-scanlines</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-render-noise"><div class="inner"><span>render-noise</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-render-rgb-scanlines"><div class="inner"><span>render-rgb-scanlines</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-render-spots"><div class="inner"><span>render-spots</span></div></a></li><li class="depth-1"><a href="clojure2d.extra.overlays.html#var-spots-overlay"><div class="inner"><span>spots-overlay</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">clojure2d.extra.overlays</h1><div class="doc"><div class="markdown"></div><div class="markdown"><h4>Categories</h4><ul></ul><p>Other vars: <a href="clojure2d.extra.overlays.html#var-noise-overlay">noise-overlay</a> <a href="clojure2d.extra.overlays.html#var-render-crt-scanlines">render-crt-scanlines</a> <a href="clojure2d.extra.overlays.html#var-render-noise">render-noise</a> <a href="clojure2d.extra.overlays.html#var-render-rgb-scanlines">render-rgb-scanlines</a> <a href="clojure2d.extra.overlays.html#var-render-spots">render-spots</a> <a href="clojure2d.extra.overlays.html#var-spots-overlay">spots-overlay</a></p></div><div class="markdown"><h4>Code snippets</h4><div><blockquote><p>Save overlays</p></blockquote><pre><code>(defn save-result
44
[f params &amp; opts]
55
(let [n (str "images/overlays/" (first opts) ".jpg")
66
c (canvas 600 800)

0 commit comments

Comments
 (0)