Add Greyscale Function
This commit is contained in:
parent
881da03825
commit
33e07962bd
3 changed files with 24 additions and 2 deletions
|
|
@ -20,6 +20,10 @@ void imgLoaded(Event e) {
|
|||
print("image loaded");
|
||||
input.context2D.drawImage(inputImg, 0, 0);
|
||||
|
||||
PixelArray px = new PixelArray.fromImageData(getImageData(input), 712);
|
||||
px = Pixed.greyscale(px);
|
||||
|
||||
output.context2D.putImageData(px.toImageData(), 0, 0);
|
||||
}
|
||||
|
||||
ImageData getImageData(CanvasElement canvas) {
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ html, body {
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
background: gainsboro;
|
||||
background: black;
|
||||
}
|
||||
|
||||
canvas {
|
||||
padding: 00px;
|
||||
padding: 0px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue