diff --git a/scripts/filters/sharpen.js b/scripts/filters/sharpen.js index b10fda1..b1be218 100644 --- a/scripts/filters/sharpen.js +++ b/scripts/filters/sharpen.js @@ -2,7 +2,7 @@ function Filter_Sharpen() { Filter.call(this); - this.parameters = []; + this.parameters = [Value]; this.render = function(cmd) { @@ -17,10 +17,12 @@ function Filter_Sharpen() var data = originalData.data; var newImage = context.getImageData(0, 0, w*2, h*2); + var strenght = cmd.value() ? cmd.value().float : 1; + var weight_map = [ - -2, 0, -2, - 0, 16, 0, - -2, 0, -2 + -2 * strenght, 0 * strenght, -2 * strenght, + 0 * strenght, 17 * strenght, 0 * strenght, + -2 * strenght, 0 * strenght, -2 * strenght ]; for(var i = 0; i < data.length; i += 4) { diff --git a/scripts/modules/preset.js b/scripts/modules/preset.js index 1266f21..01a5247 100644 --- a/scripts/modules/preset.js +++ b/scripts/modules/preset.js @@ -12,7 +12,7 @@ function Preset(rune) this.collection["custom"]["black"] = "@ 720x405 #ff0000 ; / ../assets/todo.jpg 720x 0,-30 ; % grey ; % sharpen ; % sharpen ; % chromatic 2 ; @ layer=icon ; / ../assets/logo.png 35x35 15,355 "; this.collection["photo"] = {}; - this.collection["photo"]["black"] = "@ 720x405 #ff0000 ; / ../assets/todo.jpg 720x 0,-30 ; % sharpen ; % grey % chromatic 2 ; % grey"; + this.collection["photo"]["black"] = "@ 720x405 #ff0000 ; / ../assets/todo.jpg 720x 0,-30 ; % sharpen 0.2 ; % chromatic 2 ; % grey"; this.collection["brush"] = {}; this.collection["brush"]["radial6"] = "> 600,400 60';> 600,400 120';> 600,400 180';> 600,400 240';> 600,400 300'";