src/swipl-devel/packages/xpce/man/refmanual/md/image.md

class image {#class-image}

An image is a two-dimensional array of pixels. Images are used as:

Pixels are 32-bit RGBA values. An image can also have <-kind bitmap, in which case it is interpreted as a black/white mask: white pixels paint with the current foreground, black pixels with the background. pixmap (full RGBA) is the default.

The most common case is the read-only image loaded from a file — typically used for icons. Such images are pooled in @images and shared across callers; see ->initialise and <-lookup. Read-write images backing a single bitmap are constructed with explicit dimensions; see <->access.

The image loader is SDL_image: PNG, JPEG, BMP, GIF, SVG and the other formats that SDL_image supports are all accepted. SVG is sized using the image's <-size. Saving currently only supports PNG output.

@see class bitmap @see image->initialise

Class variables {#class-image-classvars}

Instance variables {#class-image-instvars}

Send methods {#class-image-send}

Get methods {#class-image-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.