Improved sharpen

This commit is contained in:
Devine Lu Linvega 2017-02-22 16:34:28 -07:00
parent 1d5e4ec476
commit 19d971fc79
2 changed files with 7 additions and 5 deletions

View File

@ -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) {

View File

@ -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'";