Divooka Reference

Pixel Image

61 nodes

On this page 61

Make Pixel Image

Function

Overload 1 of 4

Signature
PixelImage() -> Pixel Image
PixelImage PixelImage()

This node carries no documentation.

Returns

resultPixel Image

Remarks

We must have this empty constructor because PixelImage is deserializable as instance.

Overload 2 of 4

Signature
PixelImage(width: Integer, height: Integer) -> Pixel Image
PixelImage PixelImage(int width, int height)

Creates a blank image of the given size, with every pixel transparent black (all channels 0).

Parameters

nametypedefaultdescription
widthInteger—Number of columns, in pixels.
heightInteger—Number of rows, in pixels.

Returns

resultPixel Image

Overload 3 of 4

Signature
PixelImage -> Pixel Image
    width: Integer
    height: Integer
    flat: Color Array
PixelImage PixelImage(
    int width,
    int height,
    ColorElement[] flat)

Creates an image from a single flat run of pixels, read row by row from the top-left corner.

Parameters

nametypedefaultdescription
widthInteger—Number of columns, in pixels.
heightInteger—Number of rows, in pixels.
flatColor Array—The pixels in row-major order: the first Width entries are the top row.

Returns

resultPixel Image

Remarks

The pixels are copied, so later changes to Flat do not affect the image. Any pixels beyond Width times Height are ignored.

Overload 4 of 4

Signature
PixelImage(pixels: Color Array Array) -> Pixel Image
PixelImage PixelImage(ColorElement[][] pixels)

This node carries no documentation.

Parameters

nametypedefaultdescription
pixelsColor Array Array—Direct reference without copy.

Returns

resultPixel Image

Remarks

A zero-row array is a legitimate empty image and yields a 0x0 one. Reading
pixels[0].Length unconditionally used to throw here, which made
PixelImage.Clone throw on any empty image — so callers that could legitimately hold one
had to route around cloning rather than the constructor simply answering zero.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Clone

Function

Makes an independent copy of the image, so editing the copy leaves the original untouched.

Signature
Clone(Pixel Image: Pixel Image) -> Pixel Image
PixelImage Clone(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultPixel Image

Remarks

Each row is copied up to PixelImage.Columns pixels. An empty image clones to an empty image.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Columns

Function

Width of the image in pixels, that is, the number of pixels in each row.

Signature
Columns(Pixel Image: Pixel Image) -> Integer
int Columns(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultInteger

Remarks

Setting this does not resize PixelImage.Pixels; it only changes how much of each row the image reports and reads, so it should match the pixel data.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Item

Function

Overload 1 of 2

Signature
Item(Pixel Image: Pixel Image, index: Integer) -> Color
ColorElement Item(PixelImage Pixel Image, int index)

Reads or writes a pixel by its position in row-major order, counting from 0 at the top-left corner along each row in turn, so index y * Columns + x is the pixel at column x of row y.

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
indexInteger—The pixel's position, from 0 to PixelImage.Columns × PixelImage.Rows - 1.

Returns

resultColor

Overload 2 of 2

Signature
Item(Pixel Image: Pixel Image, x: Integer, y: Integer) -> Color
ColorElement Item(PixelImage Pixel Image, int x, int y)

Reads or writes the pixel at a column and row, the same as PixelImage.GetPixel and PixelImage.SetPixel.

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
xInteger—Column, counted from 0 at the left edge.
yInteger—Row, counted from 0 at the top edge.

Returns

resultColor
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Pixels

Function

This node carries no documentation.

Signature
Pixels(Pixel Image: Pixel Image) -> Color Array Array
ColorElement[][] Pixels(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultColor Array Array

Remarks

Row-major, aka. Pixels[Row][Col] or Pixels[Height][Width]

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Raw

Function

The whole image as tightly packed RGBA bytes, four per pixel, row by row from the top-left corner; see PixelImage.ToTightlyPackedRgbaBytes.

Signature
Raw(Pixel Image: Pixel Image) -> Byte Array
byte[] Raw(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultByte Array

Remarks

Every read builds a new copy of the pixel data, so read it once and keep the result rather than reading it inside a loop.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Rows

Function

Height of the image in pixels, that is, the number of rows.

Signature
Rows(Pixel Image: Pixel Image) -> Integer
int Rows(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultInteger

Remarks

Setting this does not resize PixelImage.Pixels; it should match the number of rows in the pixel data.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Get Color

Function

The color of one pixel, exactly as stored.

Signature
GetColor -> Color
    Pixel Image: Pixel Image
    x: Integer
    y: Integer
ColorElement GetColor(PixelImage Pixel Image, int x, int y)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
xInteger—Column, counted from 0 at the left edge.
yInteger—Row, counted from 0 at the top edge.

Returns

resultColor
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Get Float Value

Function

The pixel's value read as a single number from 0 to 1, taken from its red channel alone; useful for heightmaps, masks and other grayscale data.

Signature
GetFloatValue -> Low Accuracy Number
    Pixel Image: Pixel Image
    x: Integer
    y: Integer
float GetFloatValue(PixelImage Pixel Image, int x, int y)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
xInteger—Column, counted from 0 at the left edge.
yInteger—Row, counted from 0 at the top edge.

Returns

resultLow Accuracy Number
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Get Gray Byte

Function

The pixel's value read as grayscale, which for this image is its red channel alone (green, blue and alpha are ignored).

Signature
GetGrayByte -> Byte
    Pixel Image: Pixel Image
    x: Integer
    y: Integer
byte GetGrayByte(PixelImage Pixel Image, int x, int y)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
xInteger—Column, counted from 0 at the left edge.
yInteger—Row, counted from 0 at the top edge.

Returns

resultByte
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Get Pixel

Function

The color of one pixel.

Signature
GetPixel -> Color
    Pixel Image: Pixel Image
    x: Integer
    y: Integer
ColorElement GetPixel(PixelImage Pixel Image, int x, int y)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
xInteger—Column, counted from 0 at the left edge.
yInteger—Row, counted from 0 at the top edge.

Returns

resultColor
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Get Png Buffer

Function

Overload 1 of 2

Signature
GetPngBuffer(Pixel Image: Pixel Image) -> Byte Array
byte[] GetPngBuffer(PixelImage Pixel Image)

Serialize image as raw PNG file buffer. Supports large images.

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultByte Array

Overload 2 of 2

Signature
GetPngBuffer -> Byte Array
    Pixel Image: Pixel Image
    options: Png Image Writer Options
byte[] GetPngBuffer(
    PixelImage Pixel Image,
    PngImageWriterOptions options)

Serialize image as raw PNG file buffer, with explicit encoder options. Supports large images.

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsPng Image Writer Options—

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save

Function

Overload 1 of 3

Signature
Save(Pixel Image: Pixel Image, path: Text)
void Save(PixelImage Pixel Image, string path)

Writes image as PNG to target file path.
This supports large pngs.

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—

Remarks

Encoding is delegated to BuiltinIO.PngImageWriter, which streams row by row and picks
the smallest lossless colour type for the pixel data.

Overload 2 of 3

Signature
Save
    Pixel Image: Pixel Image
    path: Text
    options: Png Image Writer Options
void Save(
    PixelImage Pixel Image,
    string path,
    PngImageWriterOptions options)

Writes image as PNG to target file path, with explicit encoder options.

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsPng Image Writer Options—

Overload 3 of 3

Signature
Save(Pixel Image: Pixel Image, stream: Stream)
void Save(PixelImage Pixel Image, Stream stream)

Writes this image as PNG to a stream.

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Bmp

Function

Writes the image as a Windows bitmap (.bmp).

Signature
SaveAsBmp
    Pixel Image: Pixel Image
    path: Text
    options: Bmp Image Writer Options
void SaveAsBmp(
    PixelImage Pixel Image,
    string path,
    BmpImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsBmp Image Writer Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Gif

Function

Writes the image as GIF. Alpha collapses to the format's single transparent index.

Signature
SaveAsGif
    Pixel Image: Pixel Image
    path: Text
    options: Gif Image Writer Options
void SaveAsGif(
    PixelImage Pixel Image,
    string path,
    GifImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsGif Image Writer Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Ico

Function

Writes the image as a Windows icon (.ico).

Signature
SaveAsIco
    Pixel Image: Pixel Image
    path: Text
    options: Ico Image Writer Options
void SaveAsIco(
    PixelImage Pixel Image,
    string path,
    IcoImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsIco Image Writer Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Jpeg

Function

Writes the image as baseline JPEG (.jpg). Lossy, and transparency is composited away.

Signature
SaveAsJpeg
    Pixel Image: Pixel Image
    path: Text
    options: Jpeg Image Writer Options
void SaveAsJpeg(
    PixelImage Pixel Image,
    string path,
    JpegImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsJpeg Image Writer Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Portable Any Map

Function

Writes the image as Netpbm (.ppm/.pgm/.pbm). Alpha is discarded.

Signature
SaveAsPortableAnyMap
    Pixel Image: Pixel Image
    path: Text
    options: Portable Any Map Image Writer Options
void SaveAsPortableAnyMap(
    PixelImage Pixel Image,
    string path,
    PortableAnyMapImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsPortable Any Map Image Writer Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Portable Float Map

Function

Writes the image as Portable FloatMap (.pfm), converting channels to 32-bit float.

Signature
SaveAsPortableFloatMap
    Pixel Image: Pixel Image
    path: Text
    options: Portable Float Map Image Writer Options
void SaveAsPortableFloatMap(
    PixelImage Pixel Image,
    string path,
    PortableFloatMapImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsPortable Float Map Image Writer Options—

Remarks

PFM is a linear format, so by default the sRGB curve is decoded on the way in. Set
PortableFloatMapImageWriterOptions.SourceTransferFunction to
ColorTransferFunction.Linear for data that is already linear, such as a
depth buffer or heightmap - it is also considerably faster.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Qoi

Function

Writes the image as Quite OK Image (.qoi) - lossless, and much faster to encode than PNG.

Signature
SaveAsQoi
    Pixel Image: Pixel Image
    path: Text
    options: Qoi Image Writer Options
void SaveAsQoi(
    PixelImage Pixel Image,
    string path,
    QoiImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsQoi Image Writer Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Text

Function

The image as Base64 text, encoding the same bytes as PixelImage.SerializeIntoBytes, for storing an image inside a text document.

Signature
SaveAsText(Pixel Image: Pixel Image) -> Text
string SaveAsText(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Tga

Function

Writes the image as Truevision TGA (.tga), run-length encoded by default.

Signature
SaveAsTga
    Pixel Image: Pixel Image
    path: Text
    options: Tga Image Writer Options
void SaveAsTga(
    PixelImage Pixel Image,
    string path,
    TgaImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsTga Image Writer Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save As Web P

Function

Writes the image as WebP (.webp): lossless, with alpha stored natively, unless WebPImageWriterOptions.Lossy asks for libwebp's lossy form.

Signature
SaveAsWebP
    Pixel Image: Pixel Image
    path: Text
    options: Web P Image Writer Options
void SaveAsWebP(
    PixelImage Pixel Image,
    string path,
    WebPImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
pathText—
optionsWeb P Image Writer Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Serialize Into Bytes

Function

Serializes the image into Divooka's own binary form, as written by PixelImage.WriteToStream.

Signature
SerializeIntoBytes(Pixel Image: Pixel Image) -> Byte Array
byte[] SerializeIntoBytes(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Set Pixel

Function

Replaces the color of one pixel, changing the image in place.

Signature
SetPixel
    Pixel Image: Pixel Image
    x: Integer
    y: Integer
    color: Color
void SetPixel(
    PixelImage Pixel Image,
    int x,
    int y,
    ColorElement color)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
xInteger—Column, counted from 0 at the left edge.
yInteger—Row, counted from 0 at the top edge.
colorColor—The new color.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Bmp Bytes

Function

Encodes the image as a Windows bitmap (.bmp) file in memory, producing the same bytes PixelImage.SaveAsBmp writes to disk.

Signature
ToBmpBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Bmp Image Writer Options
byte[] ToBmpBytes(
    PixelImage Pixel Image,
    BmpImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsBmp Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Flat Array

Function

Copies all pixels into a single array, row by row from the top-left corner, so pixel (x, y) is at index y * Columns + x.

Signature
ToFlatArray(Pixel Image: Pixel Image) -> Color Array
ColorElement[] ToFlatArray(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultColor Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Gif Bytes

Function

Encodes the image as a GIF file in memory, producing the same bytes PixelImage.SaveAsGif writes to disk.

Signature
ToGifBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Gif Image Writer Options
byte[] ToGifBytes(
    PixelImage Pixel Image,
    GifImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsGif Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Ico Bytes

Function

Encodes the image as a Windows icon (.ico) file in memory, producing the same bytes PixelImage.SaveAsIco writes to disk.

Signature
ToIcoBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Ico Image Writer Options
byte[] ToIcoBytes(
    PixelImage Pixel Image,
    IcoImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsIco Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Jpeg Bytes

Function

Encodes the image as a baseline JPEG (.jpg) file in memory, producing the same bytes PixelImage.SaveAsJpeg writes to disk.

Signature
ToJpegBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Jpeg Image Writer Options
byte[] ToJpegBytes(
    PixelImage Pixel Image,
    JpegImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsJpeg Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Portable Any Map Bytes

Function

Encodes the image as a Netpbm (.ppm/.pgm/.pbm) file in memory, producing the same bytes PixelImage.SaveAsPortableAnyMap writes to disk.

Signature
ToPortableAnyMapBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Portable Any Map Image Writer Options
byte[] ToPortableAnyMapBytes(
    PixelImage Pixel Image,
    PortableAnyMapImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsPortable Any Map Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Portable Float Map Bytes

Function

Encodes the image as a Portable FloatMap (.pfm) file in memory, producing the same bytes PixelImage.SaveAsPortableFloatMap writes to disk.

Signature
ToPortableFloatMapBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Portable Float Map Image Writer Options
byte[] ToPortableFloatMapBytes(
    PixelImage Pixel Image,
    PortableFloatMapImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsPortable Float Map Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Qoi Bytes

Function

Encodes the image as a Quite OK Image (.qoi) file in memory, producing the same bytes PixelImage.SaveAsQoi writes to disk.

Signature
ToQoiBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Qoi Image Writer Options
byte[] ToQoiBytes(
    PixelImage Pixel Image,
    QoiImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsQoi Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Tga Bytes

Function

Encodes the image as a Truevision TGA (.tga) file in memory, producing the same bytes PixelImage.SaveAsTga writes to disk.

Signature
ToTgaBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Tga Image Writer Options
byte[] ToTgaBytes(
    PixelImage Pixel Image,
    TgaImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsTga Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Tightly Packed Rgba Bytes

Function

Low-level interop conversion.

Signature
ToTightlyPackedRgbaBytes(Pixel Image: Pixel Image) -> Byte Array
byte[] ToTightlyPackedRgbaBytes(PixelImage Pixel Image)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

To Web P Bytes

Function

Encodes the image as a WebP (.webp) file in memory, producing the same bytes PixelImage.SaveAsWebP writes to disk.

Signature
ToWebPBytes -> Byte Array
    Pixel Image: Pixel Image
    options: Web P Image Writer Options
byte[] ToWebPBytes(
    PixelImage Pixel Image,
    WebPImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
optionsWeb P Image Writer Options—Encoder settings; null uses the defaults.

Returns

resultByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Update Color Data

Function

Replaces the image's pixel rows with whatever the updater returns, given the current rows.

Signature
UpdateColorData
    Pixel Image: Pixel Image
    updater: Func<Color Array Array, Color Array Array>
void UpdateColorData(
    PixelImage Pixel Image,
    Func<ColorElement[][], ColorElement[][]> updater)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
updaterFunc<Color Array Array, Color Array Array>—A function from the current [row][column] pixel grid to the new one.

Remarks

The updater receives the live pixel array, not a copy, so it may edit it in place and return it. PixelImage.Columns and PixelImage.Rows are not changed, so the returned grid should keep the same size.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Bmp

Function

Encodes the image as a Windows bitmap (.bmp) file into a stream, starting at its current position; the stream is left open.

Signature
WriteBmp
    Pixel Image: Pixel Image
    stream: Stream
    options: Bmp Image Writer Options
void WriteBmp(
    PixelImage Pixel Image,
    Stream stream,
    BmpImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsBmp Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Gif

Function

Encodes the image as a GIF file into a stream, starting at its current position; the stream is left open.

Signature
WriteGif
    Pixel Image: Pixel Image
    stream: Stream
    options: Gif Image Writer Options
void WriteGif(
    PixelImage Pixel Image,
    Stream stream,
    GifImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsGif Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Ico

Function

Encodes the image as a Windows icon (.ico) file into a stream, starting at its current position; the stream is left open.

Signature
WriteIco
    Pixel Image: Pixel Image
    stream: Stream
    options: Ico Image Writer Options
void WriteIco(
    PixelImage Pixel Image,
    Stream stream,
    IcoImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsIco Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Jpeg

Function

Encodes the image as a baseline JPEG (.jpg) file into a stream, starting at its current position; the stream is left open.

Signature
WriteJpeg
    Pixel Image: Pixel Image
    stream: Stream
    options: Jpeg Image Writer Options
void WriteJpeg(
    PixelImage Pixel Image,
    Stream stream,
    JpegImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsJpeg Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Portable Any Map

Function

Encodes the image as a Netpbm (.ppm/.pgm/.pbm) file into a stream, starting at its current position; the stream is left open.

Signature
WritePortableAnyMap
    Pixel Image: Pixel Image
    stream: Stream
    options: Portable Any Map Image Writer Options
void WritePortableAnyMap(
    PixelImage Pixel Image,
    Stream stream,
    PortableAnyMapImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsPortable Any Map Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Portable Float Map

Function

Encodes the image as a Portable FloatMap (.pfm) file into a stream, starting at its current position; the stream is left open.

Signature
WritePortableFloatMap
    Pixel Image: Pixel Image
    stream: Stream
    options: Portable Float Map Image Writer Options
void WritePortableFloatMap(
    PixelImage Pixel Image,
    Stream stream,
    PortableFloatMapImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsPortable Float Map Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Qoi

Function

Encodes the image as a Quite OK Image (.qoi) file into a stream, starting at its current position; the stream is left open.

Signature
WriteQoi
    Pixel Image: Pixel Image
    stream: Stream
    options: Qoi Image Writer Options
void WriteQoi(
    PixelImage Pixel Image,
    Stream stream,
    QoiImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsQoi Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Tga

Function

Encodes the image as a Truevision TGA (.tga) file into a stream, starting at its current position; the stream is left open.

Signature
WriteTga
    Pixel Image: Pixel Image
    stream: Stream
    options: Tga Image Writer Options
void WriteTga(
    PixelImage Pixel Image,
    Stream stream,
    TgaImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsTga Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write To Stream

Function

Writes the image in Divooka's binary form: four 32-bit integers (format version 1, width, height, payload length in bytes) followed by the tightly packed RGBA pixels, row by row from the top.

Signature
WriteToStream -> Large Integer
    Pixel Image: Pixel Image
    writer: BinaryWriter
long WriteToStream(PixelImage Pixel Image, BinaryWriter writer)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
writerBinaryWriter—The writer to append to.

Returns

resultLarge Integer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Write Web P

Function

Encodes the image as a WebP (.webp) file into a stream, starting at its current position; the stream is left open.

Signature
WriteWebP
    Pixel Image: Pixel Image
    stream: Stream
    options: Web P Image Writer Options
void WriteWebP(
    PixelImage Pixel Image,
    Stream stream,
    WebPImageWriterOptions options)

Parameters

nametypedefaultdescription
Pixel ImagePixel Image—
streamStream—A writable stream to receive the file.
optionsWeb P Image Writer Options—Encoder settings; null uses the defaults.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Allocate Pixels

Function

Allocates a new [row][column] pixel grid of the given size, filled with one color.

Signature
AllocatePixels -> Color Array Array
    width: Integer
    height: Integer
    color: Optional Color
ColorElement[][] AllocatePixels(
    int width,
    int height,
    ColorElement? color)

Parameters

nametypedefaultdescription
widthInteger—Number of pixels in each row.
heightInteger—Number of rows.
colorOptional Color—The fill color; null leaves every pixel transparent black (all channels 0).

Returns

resultColor Array Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

From Flat Array

Function

Creates an image from a single array of pixels laid out row by row from the top-left corner, the inverse of PixelImage.ToFlatArray.

Signature
FromFlatArray -> Pixel Image
    width: Integer
    height: Integer
    flat: Color Array
PixelImage FromFlatArray(
    int width,
    int height,
    ColorElement[] flat)

Parameters

nametypedefaultdescription
widthInteger—Number of columns, in pixels.
heightInteger—Number of rows, in pixels.
flatColor Array—Exactly Width × Height pixels; the first Width are the top row.

Returns

resultPixel Image

Remarks

The pixels are copied, so later changes to Flat do not affect the image.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

From Packed Int Pixels

Function

Creates an image from rows of 32-bit packed pixels, one uint per pixel, indexed [row][column].

Signature
FromPackedIntPixels(packedPixels: Positive Integer Array Array) -> Pixel Image
PixelImage FromPackedIntPixels(uint[][] packedPixels)

Parameters

nametypedefaultdescription
packedPixelsPositive Integer Array Array—The packed pixels, row-major, every row as long as the first.

Returns

resultPixel Image

Remarks

Each value is split into bytes in the machine's byte order and read as red, green, blue, alpha, so on little-endian hardware the lowest byte is red and the highest is alpha (0xAABBGGRR). The width is taken from the first row, and the values are copied into a new pixel grid.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

From Packed RGBA Bytes

Function

Overload 1 of 2

Signature
FromPackedRGBABytes -> Pixel Image
    width: Integer
    height: Integer
    rawBytes: Byte Array
PixelImage FromPackedRGBABytes(
    int width,
    int height,
    byte[] rawBytes)

Creates an image from tightly packed RGBA bytes, four per pixel (red, green, blue, alpha), row by row from the top-left corner with no padding.

Parameters

nametypedefaultdescription
widthInteger—Number of columns, in pixels.
heightInteger—Number of rows, in pixels.
rawBytesByte Array—Exactly Width × Height × 4 bytes.

Returns

resultPixel Image

Remarks

The bytes are copied, so later changes to Raw Bytes do not affect the image. A height of 0 gives an empty image.

Overload 2 of 2

Signature
FromPackedRGBABytes -> Pixel Image
    RGBA: Byte Array
    width: Integer
    height: Integer
PixelImage FromPackedRGBABytes(
    byte[] rgba,
    int width,
    int height)

Legacy overload; Pending consolidation.

Parameters

nametypedefaultdescription
RGBAByte Array—
widthInteger—
heightInteger—

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

From Uri

Function

Loads an image from a file path or a web address, in any format PixelImage.LoadFromFile accepts.

Signature
FromUri(uri: Uri) -> Pixel Image
PixelImage FromUri(Uri uri)

Parameters

nametypedefaultdescription
uriUri—A relative path, a file URI, or an http/https URL.

Returns

resultPixel Image

Remarks

A relative URI is resolved against the current working directory and a file URI is read from disk. An http or https URI is downloaded in full, synchronously, before decoding.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Get Temp Image Path

Function

This node carries no documentation.

Signature
GetTempImagePath() -> Text
string GetTempImagePath()

Returns

resultText

Remarks

Should only be used for really getting a temp image path and no longer used for conversion.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Initialize Black Image

Function

Initialize image with some color

Signature
InitializeBlackImage -> Pixel Image
    width: Integer
    height: Integer
    color: Optional Color
PixelImage InitializeBlackImage(
    int width,
    int height,
    ColorElement? color)

Parameters

nametypedefaultdescription
widthInteger—
heightInteger—
colorOptional Color—

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Initialize From Bytes

Function

Rebuilds an image from bytes produced by PixelImage.SerializeIntoBytes.

Signature
InitializeFromBytes(data: Byte Array) -> Pixel Image
PixelImage InitializeFromBytes(byte[] data)

Parameters

nametypedefaultdescription
dataByte Array—The serialized image.

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Load From File

Function

Load from PNG file.
In reality, supports wider range of input options than PixelImage.LoadFromFile.

Signature
LoadFromFile(path: Text) -> Pixel Image
PixelImage LoadFromFile(string path)

Parameters

nametypedefaultdescription
pathText—

Returns

resultPixel Image

Remarks

Though officially we support only PNG file on Image.PixelImage; In practice this can load more than that.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Load From File Buffer

Function

This node carries no documentation.

Signature
LoadFromFileBuffer(fileData: Byte Array) -> Pixel Image
PixelImage LoadFromFileBuffer(byte[] fileData)

Parameters

nametypedefaultdescription
fileDataByte Array—Png, jpg, bmp, webp... Anything you like!

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Load From Text

Function

Rebuilds an image from Base64 text produced by PixelImage.SaveAsText.

Signature
LoadFromText(text: Text) -> Pixel Image
PixelImage LoadFromText(string text)

Parameters

nametypedefaultdescription
textText—The Base64 text.

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Load Packed Rgba From File Buffer

Function

Decodes an image straight to tightly packed RGBA bytes, row zero first, without building
a Image.PixelImage on the way.

Signature
LoadPackedRgbaFromFileBuffer(fileData: Byte Array) -> (result: Byte Array, width: Integer, height: Integer)
byte[] LoadPackedRgbaFromFileBuffer(
    byte[] fileData,
    out int width,
    out int height)

Parameters

nametypedefaultdescription
fileDataByte Array—Png, jpg, bmp, webp... Anything PixelImage.LoadFromFileBuffer takes.

Returns

resultByte Array
widthInteger
heightInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Read From Stream

Function

Reads an image written by PixelImage.WriteToStream, leaving the reader just past it.

Signature
ReadFromStream(reader: BinaryReader) -> (result: Large Integer, value: Pixel Image)
long ReadFromStream(BinaryReader reader, out PixelImage value)

Parameters

nametypedefaultdescription
readerBinaryReader—The reader positioned at the image.

Returns

resultLarge Integer
valuePixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing

Save Raw

Function

Compact fast raw data dump that writes a tiny header (magic + version + width + height) followed by tightly packed RGBA bytes for every pixel in row-major order.

Signature
SaveRaw
    path: Text
    pixels: Color Array Array
    width: Integer
    height: Integer
void SaveRaw(
    string path,
    ColorElement[][] pixels,
    int width,
    int height)

Parameters

nametypedefaultdescription
pathText—
pixelsColor Array Array—
widthInteger—
heightInteger—

Remarks

It uses MemoryMarshal.AsBytes so we avoid per-pixel copying.

### Format summary

**Header (9 bytes total):**
* `PXLR` (ASCII)
* `1` (byte: format version)
* `width` (Int32, little-endian)
* `height` (Int32, little-endian)

**Data:** `height` rows × `width` pixels × **4 bytes per pixel** (R, G, B, A), no padding.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Pixel Image
Package
Image Processing