Permalink
Browse files

More tinkering on multiple filters; narrowed down noise as the proble…

…m child, not sure why yet
  • Loading branch information...
1 parent d3a4136 commit 097a19c2f8177f1ad91aed5400c701472de6b05a Dave Shea committed Aug 24, 2010
Showing with 16 additions and 6 deletions.
  1. +4 −3 demo/script/paintbrush-0.1.js
  2. +12 −3 demo/torture-test.html
@@ -28,9 +28,11 @@ addLoadEvent(function() {
// you can add or remove lines here, depending on which filters you're using.
addFilter("filter-blur");
addFilter("filter-greyscale");
- addFilter("filter-noise");
addFilter("filter-sepia");
addFilter("filter-tint");
+
+ // if noise comes last, it seems all combinations work. if it doesn't, others fail. I don't get this.
+ addFilter("filter-noise");
}
// only use this if you're going to time the script, otherwise you can safely delete the next three lines
@@ -253,8 +255,7 @@ function addFilter(filterType) {
function applyFilters(filterType, params, pixels, index, thisPixel, dest) {
// speed up access
- var data = pixels.data,
- val;
+ var data = pixels.data, val;
// figure out which filter to apply, and do it
switch(filterType) {
View
@@ -32,7 +32,7 @@
</li>
<li>
<figure>
- <img src="images/120-circles.png" class="filter-tint filter-noise filter-greyscale" data-pb-noise-amount="50" data-pb-tint-colour="#0f0" data-pb-tint-amount="0.2" width="120" height="80" alt="torture">
+ <img src="images/120-circles.png" class="filter-tint filter-noise filter-greyscale" data-pb-noise-amount="50" data-pb-tint-colour="#0f0" data-pb-tint-amount="0.1" width="120" height="80" alt="torture">
<figcaption>greyscale + noise + tint</figcaption>
</figure>
</li>
@@ -52,7 +52,7 @@
</li>
<li>
<figure>
- <img src="images/120-circles.png" class="filter-tint filter-blur filter-greyscale" data-pb-blur-amount="5" data-pb-tint-colour="#0f0" data-pb-tint-amount="0.08" width="120" height="80" alt="torture">
+ <img src="images/120-circles.png" class="filter-tint filter-blur filter-greyscale" data-pb-blur-amount="5" data-pb-tint-colour="#0f0" data-pb-tint-amount="0.15" width="120" height="80" alt="torture">
<figcaption>greyscale + blur + tint</figcaption>
</figure>
</li>
@@ -72,11 +72,20 @@
</li>
<li>
<figure>
- <img src="images/120-circles.png" class="filter-tint filter-noise" data-pb-noise-amount="50" data-pb-tint-colour="#0ff" data-pb-tint-amount="0.08" width="120" height="80" alt="torture">
+ <img src="images/120-circles.png" class="filter-tint filter-noise" data-pb-noise-amount="50" data-pb-tint-colour="#0ff" data-pb-tint-amount="0.2" width="120" height="80" alt="torture">
<figcaption>tint + noise</figcaption>
</figure>
</li>
</ul>
+ <ul>
+ <li>
+ <figure>
+ <img src="images/120-circles.png" class="filter-greyscale filter-noise filter-blur" data-pb-noise-amount="50" data-pb-blur-amount="2" width="120" height="80" alt="torture">
+ <figcaption>greyscale + noise + blur</figcaption>
+ </figure>
+ </li>
+ </ul>
+
<h2>Transparency Test</h2>
<ul>

0 comments on commit 097a19c

Please sign in to comment.