Constructs an empty image.
Constructs an image of the given size using the given format. The format is defined by one of the Image.Format_
values.
Constructs an image from the given data, interpreting it in the
specified format and size. The format is defined by one of the Image.Format_
values.
Constructs an image from the given data, interpreting it in the
specified format and size. The bytesPerLine
argument
specifies the stride and can be useful for referencing a sub-image.
The format is defined by one of the Image.Format_
values.
Construct an image by loading it from the given file name. When no format is given it will be auto-detected (can be "bmp", "png", etc.).
Number of bits used to store a single pixel.
Format of the image. The format is defined by one of the Image.Format_
values.
Height of the image in pixels.
Size of the image in pixels.
Width of the image in pixels.
Returns the 32-bit color value at the given index in the color table.
Returns the color table as an array of 32-bit color values.
Copies the given rectangle to a new image object.
When no rectangle is given, the entire image is copied.
Copies the given rectangle to a new image object.
Fills the image with the given 32-bit unsigned color value (ARGB) or color table index.
Fills the image with the given color (supports values like "#rrggbb" or those created by tiled.color).
Loads the image from the given file name. When no format is given it will be auto-detected (can be "bmp", "png", etc.).
Loads the image from the given data interpreted with the given format (can be "bmp", "png", etc.).
Returns a mirrored copy of this image.
Returns the 32-bit unsigned color value (in ARGB order).
Returns the color at the given position as string like "#rrggbb".
Saves the image to the given file.
When no format is given it will be auto-detected based on the file extension.
Saves the image to an ArrayBuffer in the given format (can be "bmp", png", etc.).
Returns a scaled copy of this image. Default aspectRatioMode
behavior is to ignore the aspect ratio. Default mode
is a fast
transformation.
Sets the color at the given index in the color table to a given 32-bit color value.
Sets the color at the given index in the color table to a color (supports values like "#rrggbb" or those created by tiled.color).
Sets the color table given by an array of either 32-bit color values or strings (supports values like "#rrggbb").
Sets the color at the specified location to the given 32-bit unsigned color value (ARGB) or color table index.
Sets the color at the specified location to the given color (supports values like "#rrggbb" or those created by tiled.color).
Generated using TypeDoc
Can be used to create, load, save and modify images.
Also useful when writing an importer, where the image can be set on a tileset (Tileset.loadFromImage), its tiles (Tile.setImage) or an image layer (ImageLayer.setImage).
1.5