BaseImageContent
Every picture shares these tools. Wipe it, paint one picture over another, resize it cleanly, or wire a colour straight into it.
BaseImageContent is the abstract base of ImageContent. Size is its resolution, Path an optional file and DrawnFrom the camera that drew it last. image:Clear(), image:DrawOnto(other), image:Stretch(size) and image:Resample(size, mode, fit) change its pixels; image:MagicWand(point) gives the mask of the pixels near that pixel's colour, and image:Load(path) reads a picture file. On a node card every picture has Color and Alpha outputs; a plain image also takes Color and Alpha inputs, which win over its own pixels while they are wired.
Properties
File
| Name | Type | Default | Description |
|---|---|---|---|
| DrawnFrom | Camera | The camera that drew it; a viewport showing the image looks, flies, orbits and edits through that camera. | |
| Path | string | A file that overrides the bytes stored in the place. | |
| Resolution | read-only text | Properties window only |
Image
| Size | Vector2 | 512, 512 | Reads the image's resolution; setting it sets its blank size. |
| SizeSet | boolean | false Properties window only | Keeps the image's own Size and stretches the wired input to it. |
Outputs
| Image | ImageContent | Its Color output socket on the node card, always on, shown with a thumbnail and the size. | |
| ImageAlpha | ImageContent | Its Alpha output socket on the node card, always on. |
Inputs
| ColorIn | ImageContent | Properties window only | Gives the image its colour when wired; with only Alpha wired, the image keeps its own pixels. |
| AlphaIn | ImageContent | Properties window only | Gives the image its alpha: a number, a mask, or a colour by luminance; else it takes the Color input's alpha. |
Image cache (all images)
| ImageCacheMB | number | 4096 Properties window only; 256 to 65536 | The texture budget for all images; past it, the least recently drawn ones are dropped and decode again when shown. |
| ImageCacheInMemory | read-only text | Properties window only |
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| Clear | (color: Color3?, alpha: number?) | () | With no arguments wipes the image to transparent; with a color fills it, alpha 1 unless given. |
| DrawOnto | (target: ImageContent) | () | Paints this image over the target: an Image2D at its Position, AnchorPoint and Size, any other image at the top left. |
| Load | (path: string) | () | Loads the picture from a file; when a playing script does it, Stop puts the image back. |
| MagicWand | (point: Vector2, tolerance: number?, contiguous: boolean?) | ImageContent | The mask of the pixels near the clicked pixel's colour, contiguous by default, as an image. |
| Resample | (size: Vector2, mode: ("Nearest" | "Bilinear" | "Bicubic" | "Lanczos")?, fit: ("Stretch" | "Fit" | "Fill" | "Center")?) | () | Resamples the image to a size with a chosen sampling and fit, without aliasing when it shrinks. |
| Stretch | (size: Vector2) | () | Resamples the image to the given size. |
From Instance 22
Subclasses
