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

NameTypeDefaultDescription
DrawnFromCameraThe camera that drew it; a viewport showing the image looks, flies, orbits and edits through that camera.
PathstringA file that overrides the bytes stored in the place.
Resolutionread-only textProperties window only

Image

SizeVector2512, 512Reads the image's resolution; setting it sets its blank size.
SizeSetbooleanfalse
Properties window only
Keeps the image's own Size and stretches the wired input to it.

Outputs

ImageImageContentProperties window onlyIts Color output socket on the node card, always on, shown with a thumbnail and the size.
ImageAlphaImageContentProperties window onlyIts Alpha output socket on the node card, always on.

Inputs

ColorInImageContentProperties window onlyGives the image its colour when wired; with only Alpha wired, the image keeps its own pixels.
AlphaInImageContentProperties window onlyGives 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)

ImageCacheMBnumber4096
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.
ImageCacheInMemoryread-only textProperties window only

Methods

NameArgumentsReturnsDescription
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