Image
Last updated
Last updated
Helper module for image processing.
These functions and classes are only used internally, meaning an end-user shouldn’t need to access anything here.
instance
⇒ RawImage
⇒ RawImage
⇒ RawImage
⇒ Promise.<RawImage>
⇒ RawImage
⇒ RawImage
static
⇒ *
⇒ Promise.<RawImage>
⇒ Promise.<RawImage>
instance
static
Create a new RawImage
object.
data
Uint8ClampedArray
The pixel data.
width
number
The width of the image.
height
number
The height of the image.
channels
1
| 2
| 3
| 4
The number of channels.
Mapping from file extensions to MIME types.
Convert the image to grayscale format.
Convert the image to RGB format.
Convert the image to RGBA format.
Resize the image to the given dimensions. This method uses the canvas API to perform the resizing.
width
number
The width of the new image.
height
number
The height of the new image.
options
Object
Additional options for resizing.
[options.resample]
0
| 1
| 2
| 3
| 4
| 5
| string
The resampling method to use.
Clone the image
Helper method for converting image to have a certain number of channels
numChannels
number
The number of channels. Must be 1, 3, or 4.
Save the image to the given path.
path
string
The path to save the image to.
Helper method for reading an image from a variety of input types.
Example: Read image from a URL.
Copied
input
RawImage
| string
| URL
Read an image from a URL or file path.
url
string
| URL
The URL or file path to read the image from.
Helper method to create a new Image from a blob.
blob
Blob
The blob to read the image from.
Kind: static class of
⇒ RawImage
⇒ RawImage
⇒ RawImage
⇒ Promise.<RawImage>
⇒ RawImage
⇒ RawImage
⇒ *
⇒ Promise.<RawImage>
⇒ Promise.<RawImage>
Kind: instance property of
Kind: instance method of
Returns: RawImage
- this
to support chaining.
Kind: instance method of
Returns: RawImage
- this
to support chaining.
Kind: instance method of
Returns: RawImage
- this
to support chaining.
Kind: instance method of
Returns: Promise.<RawImage>
- this
to support chaining.
Kind: instance method of
Returns: RawImage
- The cloned image
Kind: instance method of
Returns: RawImage
- this
to support chaining.
Kind: instance method of
Kind: static method of
Returns: *
- The image object.
Kind: static method of
Returns: Promise.<RawImage>
- The image object.
Kind: static method of
Returns: Promise.<RawImage>
- The image object.