1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
| let draw = SVG().addTo('body').size(1200, 1200); const W = 180; const H = 120;
let image = null;
image = draw.image('./test.jpg').size(W, H).move(0 * W, 0 * H); image.filterWith(add => { add.gaussianBlur(2); })
image = draw.image('./test.jpg').size(W, H).move(1 * W, 0 * H); image.filterWith(add => { add.gaussianBlur(2, 0); })
image = draw.image('./test.jpg').size(W, H).move(2 * W, 0 * H); image.filterWith(add => { add.colorMatrix('saturate', 0); })
image = draw.image('./test.jpg').size(W, H).move(3 * W, 0 * H); image.filterWith(add => { let amount = 4 add.componentTransfer({ type: 'linear', slope: amount, intercept: -(0.3 * amount) + 0.3 }) })
image = draw.image('./test.jpg').size(W, H).move(0 * W, 1 * H); image.filterWith(add => { add.colorMatrix('matrix', [ .343, .669, .119, 0, 0 , .249, .626, .130, 0, 0 , .172, .334, .111, 0, 0 , .000, .000, .000, 1, 0 ]) })
image = draw.image('./test.jpg').size(W, H).move(1 * W, 1 * H); image.filterWith(add => { add.colorMatrix('hueRotate', 180) })
image = draw.image('./test.jpg').size(W, H).move(2 * W, 1 * H); image.filterWith(add => { add.colorMatrix('luminanceToAlpha') })
image = draw.image('./test.jpg').size(W, H).move(3 * W, 1 * H); image.filterWith(add => { add.colorMatrix('matrix', [ 1.0, 0, 0, 0, 0 , 0, 0.2, 0, 0, 0 , 0, 0, 0.2, 0, 0 , 0, 0, 0, 1.0, 0 ]) })
image = draw.image('./test.jpg').size(W, H).move(0 * W, 2 * H); image.filterWith(function(add) { add.morphology("dilate", 2); })
image = draw.image('./test.jpg').size(W, H).move(1 * W, 2 * H); image.filterWith(function(add) { let blur = add.offset(0, 1).in(add.$sourceAlpha).gaussianBlur(1) add.blend(add.$source, blur) })
image = draw.image('./test.jpg').size(W, H).move(2 * W, 2 * H); image.filterWith(function(add){ var matrix = add.convolveMatrix([ 1,0,0,0,0,0, 0,1,0,0,0,0, 0,0,1,0,0,0, 0,0,0,1,0,0, 0,0,0,0,1,0, 0,0,0,0,0,1 ]).attr({ devisor: '2', preserveAlpha: 'false' }).in(add.$sourceAlpha)
var color = add.composite(add.flood('#ff2222'),matrix,'in');
add.merge(color,add.$source); })
|