Skip to content

Commit

Permalink
More tinkering on multiple filters; narrowed down noise as the proble…
Browse files Browse the repository at this point in the history
…m child, not sure why yet
  • Loading branch information
Dave Shea authored and Dave Shea committed Aug 24, 2010
1 parent d3a4136 commit 097a19c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 4 additions & 3 deletions demo/script/paintbrush-0.1.js
Expand Up @@ -28,9 +28,11 @@ addLoadEvent(function() {
// you can add or remove lines here, depending on which filters you're using. // you can add or remove lines here, depending on which filters you're using.
addFilter("filter-blur"); addFilter("filter-blur");
addFilter("filter-greyscale"); addFilter("filter-greyscale");
addFilter("filter-noise");
addFilter("filter-sepia"); addFilter("filter-sepia");
addFilter("filter-tint"); 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 // only use this if you're going to time the script, otherwise you can safely delete the next three lines
Expand Down Expand Up @@ -253,8 +255,7 @@ function addFilter(filterType) {
function applyFilters(filterType, params, pixels, index, thisPixel, dest) { function applyFilters(filterType, params, pixels, index, thisPixel, dest) {


// speed up access // speed up access
var data = pixels.data, var data = pixels.data, val;
val;


// figure out which filter to apply, and do it // figure out which filter to apply, and do it
switch(filterType) { switch(filterType) {
Expand Down
15 changes: 12 additions & 3 deletions demo/torture-test.html
Expand Up @@ -32,7 +32,7 @@ <h2>Multiple Filters</h2>
</li> </li>
<li> <li>
<figure> <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> <figcaption>greyscale + noise + tint</figcaption>
</figure> </figure>
</li> </li>
Expand All @@ -52,7 +52,7 @@ <h2>Multiple Filters</h2>
</li> </li>
<li> <li>
<figure> <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> <figcaption>greyscale + blur + tint</figcaption>
</figure> </figure>
</li> </li>
Expand All @@ -72,11 +72,20 @@ <h2>Multiple Filters</h2>
</li> </li>
<li> <li>
<figure> <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> <figcaption>tint + noise</figcaption>
</figure> </figure>
</li> </li>
</ul> </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> <h2>Transparency Test</h2>
<ul> <ul>
Expand Down

0 comments on commit 097a19c

Please sign in to comment.