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 and so of every picture. 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. 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 | Properties window only | Its Color output socket on the node card, always on, shown with a thumbnail and the size. |
| ImageAlpha | ImageContent | Properties window only | 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) | () | |
| MagicWand | (point: Vector2, tolerance: number?, contiguous: boolean?) | ImageContent | |
| 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
