Skip to content

Commit

Permalink
Updated Jimp example
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhanergen-tech committed Jul 3, 2023
1 parent d58b0ff commit c08b229
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ Matrix.constArithmeticProcess(matrix,3,"mul",2)
<code>
import { Matrix } from './index'
import * as jimp from 'jimp'

const rgbToGray=async ()=>{
const myarray:number[][] = [];

Expand All @@ -130,11 +129,10 @@ const rgbToGray=async ()=>{
})
})


return myarray;
}

</code>
<code>
const createImage=(path:string,x:number,y:number,array:number[][])=>{
const test=new jimp(x,y);
const bitmap=test.bitmap;
Expand All @@ -149,11 +147,10 @@ const createImage=(path:string,x:number,y:number,array:number[][])=>{
bitmap.data[idx + 3] = 255
i++;
})

test.writeAsync(path);

test.writeAsync(path);
}
</code>

<code>
const init=async ()=>{
const img=new Matrix(await rgbToGray() as number[][],"UInt8");
Expand Down

0 comments on commit c08b229

Please sign in to comment.