Methods
copy
- copy(src: Image, destX: number, destY: number, sourceRect?: IntRect, applyAlpha?: boolean): void
-
Parameters
-
-
destX: number
-
destY: number
-
Optional sourceRect: IntRect
-
Optional applyAlpha: boolean
Returns void
create
- create(width: number, height: number, colorOrPixels: number | Color | Buffer | number[] | ArrayBuffer | Uint8Array): void
-
Parameters
-
width: number
-
height: number
-
colorOrPixels: number | Color | Buffer | number[] | ArrayBuffer | Uint8Array
Returns void
createMaskColor
- createMaskColor(color: number | Color, alpha?: number): void
-
Parameters
-
color: number | Color
-
Optional alpha: number
Returns void
duplicatePixels
- duplicatePixels(): Buffer
getPixel
- getPixel(x: number, y: number): Color
loadFromFile
- loadFromFile(filename: string): Promise<boolean>
-
Parameters
Returns Promise<boolean>
loadFromFileSync
- loadFromFileSync(filename: string): boolean
-
Parameters
Returns boolean
loadFromMemory
- loadFromMemory(buff: Buffer): boolean
-
Parameters
Returns boolean
saveToFile
- saveToFile(filename: string): Promise<void>
-
Parameters
Returns Promise<void>
setPixel
- setPixel(x: number, y: number, color: number | Color): void
-
Parameters
-
x: number
-
y: number
-
color: number | Color
Returns void