Skip to content
Permalink
Browse files

minor tweak

  • Loading branch information...
Jeremy Heminger Jeremy Heminger
Jeremy Heminger authored and Jeremy Heminger committed Apr 3, 2019
1 parent 28e1134 commit a518ec7609f76287c5e2e0db90f2508aeb7fb418
Showing with 9 additions and 6 deletions.
  1. +2 −2 index.html
  2. +7 −4 script.js
@@ -17,10 +17,10 @@
const W = 500
const H = 700
const N = 15 // nearest color threashold
// call the sub class
let test = new classes.ReduceColors()
// create and reference some canvases
let i = test.canvas(document.getElementById("original"),W,H)
let j = test.canvas(document.getElementById("target"),W,H)
@@ -30,7 +30,7 @@
.then(function(images){
test.draw(i,images[0].img)
.getData(i)
.nearestPixel(i,N)
.nearestPixel(i,15)
.grayScale(3)
.FSDither(10)
.drawBuffer(j)
@@ -140,7 +140,8 @@ export class ReduceColors extends ImageData {
}
// ----- Wrappers for private methods that need to be looped using loopPixels in the base class
/**
* @param {Object} params
* @param {Number} a canvas context index
* @param {Number} b nearest pixel range ( size )
* @returns {Object}
* */
nearestPixel(a,b) {
@@ -154,7 +155,7 @@ export class ReduceColors extends ImageData {
return this
}
/**
* @param {Object} params
* @param {Number} a strength
* @returns {Object}
* */
grayScale(a) {
@@ -166,7 +167,7 @@ export class ReduceColors extends ImageData {
return this
}
/**
* @param {Object} params
* @param {Number} a strength
* @returns {Object}
* */
FSDither(a) {
@@ -178,7 +179,7 @@ export class ReduceColors extends ImageData {
return this
}
/**
* @param {Object} params
* @param {Number} a strength
* @returns {Object}
* */
reduceColor(params) {
@@ -187,7 +188,9 @@ export class ReduceColors extends ImageData {
.then(()=>{})
return this
}

// ----- PRIVATE

/**
* @param {Object}
* @param {Number}

0 comments on commit a518ec7

Please sign in to comment.
You can’t perform that action at this time.