Skip to main content

ImageBitmap

Interface for handling bitmap image operations. Provides functionality for image manipulation and drawing.

Properties​

width​

Width of the image in pixels.

readonly width: number

height​

Height of the image in pixels.

readonly height: number

channels​

Number of color channels in the image.

readonly channels: number

data​

Raw image data as ArrayBuffer.

readonly data: ArrayBuffer

Methods​

drawRect​

Draw a rectangle on the image.

drawRect(rect: FaceRect, color: Color, thickness: number): void

Parameters​

NameTypeDescription
rectFaceRectRectangle coordinates and dimensions
colorColorRGB color for drawing
thicknessnumberLine thickness in pixels

Returns​

  • void

drawCircleF​

Draw a circle using floating-point coordinates.

drawCircleF(point: Point2f, radius: number, color: Color, thickness: number): void

Parameters​

NameTypeDescription
pointPoint2fCenter point of the circle
radiusnumberRadius of the circle
colorColorRGB color for drawing
thicknessnumberLine thickness in pixels

Returns​

  • void

drawCircle​

Draw a circle using integer coordinates.

drawCircle(point: Point2i, radius: number, color: Color, thickness: number): void

Parameters​

NameTypeDescription
pointPoint2iCenter point of the circle
radiusnumberRadius of the circle
colorColorRGB color for drawing
thicknessnumberLine thickness in pixels

Returns​

  • void

writeToFile​

Write the bitmap to an image file.

writeToFile(filePath: string): void

Parameters​

NameTypeDescription
filePathstringPath where the image will be saved

Returns​

  • void

copy​

Create a copy of this bitmap.

copy(): ImageBitmap

Returns​