Represents a bitmap image
images can be created from create_image or load_png
- get_alpha
- get_blue
- get_green
- get_pixel
- get_red
- gradient_scale
- height
- save
- set_pixel
- set_pixel_floats
- width
+ new image(): image
Returns: image
▸ get_alpha(x
: number, y
: number): number
Returns the alpha channel (between 0-1) at an image coordinate
Name | Type |
---|---|
x |
number |
y |
number |
Returns: number
▸ get_blue(x
: number, y
: number): number
Returns the blue channel (between 0-1) at an image coordinate
Name | Type |
---|---|
x |
number |
y |
number |
Returns: number
▸ get_green(x
: number, y
: number): number
Returns the green channel (between 0-1) at an image coordinate
Name | Type |
---|---|
x |
number |
y |
number |
Returns: number
▸ get_pixel(x
: number, y
: number): number
Returns the pixel value at a coordinate
Name | Type |
---|---|
x |
number |
y |
number |
Returns: number
▸ get_red(x
: number, y
: number): number
Returns the red channel (between 0-1) at an image coordinate
Name | Type |
---|---|
x |
number |
y |
number |
Returns: number
▸ gradient_scale(rel
: number): number
Returns the pixel value at a relative horizontal coordinate
Name | Type | Description |
---|---|---|
rel |
number | horizontal relative position (between 0-1) |
Returns: number
▸ height(): number
Returns the height of this image
Returns: number
▸ save(filename
: string): any
Saves this image to a file
Name | Type |
---|---|
filename |
string |
Returns: any
▸ set_pixel(x
: number, y
: number, value
: number): void
Sets the pixel value at an image coordinate
Name | Type |
---|---|
x |
number |
y |
number |
value |
number |
Returns: void
▸ set_pixel_floats(x
: number, y
: number, r
: number, g
: number, b
: number, a
: number): void
Sets the pixel value at an image coordinate
Name | Type | Description |
---|---|---|
x |
number | |
y |
number | |
r |
number | should be between 0-1 |
g |
number | should be between 0-1 |
b |
number | should be between 0-1 |
a |
number | should be between 0-1 |
Returns: void
▸ width(): number
Returns the width of this image
Returns: number