wx.Image

Inheritance diagram for wx.Image:



Description

This class encapsulates a platform-independent image. An image can be created from data, or using wx.Bitmap.ConvertToImage. An image can be loaded from a file in a variety of formats, and is extensible to new formats via image format handlers. Functions are available to set and get image bits, so it can be used for basic image manipulation.

A wx.Image cannot (currently) be drawn directly to a wx.DC. Instead, a platform-specific wx.Bitmap object must be created from it using the ConvertToBitmap method. This bitmap can then be drawn in a device context, using wx.DC.DrawBitmap.

One colour value of the image may be used as a mask colour which will lead to the automatic creation of a wx.Mask object associated to the bitmap object.

wx.Image supports alpha channel data, that is in addition to a byte for the red, green and blue colour components for each pixel it also stores a byte representing the pixel opacity. An alpha value of 0 corresponds to a transparent pixel (null opacity) while a value of 255 means that the pixel is 100% opaque.

Unlike RGB data, not all images have an alpha channel and before using GetAlpha you should check if this image contains an alpha channel with HasAlpha.

Note

Note that currently only images loaded from PNG files with transparency information will have an alpha channel.

See also

wx.Bitmap

Derived From

Class API

Methods

__init__(name, type=wx.BITMAP_TYPE_ANY, index=-1)

Loads an image from a file.

Parameters:

  • name (string): Name of the file from which to load the image.

  • type (int): One of the following values:

    Bitmap Type Constant

    Description

    wx.BITMAP_TYPE_BMP

    Load a Windows image file.

    wx.BITMAP_TYPE_GIF

    Load a GIF image file.

    wx.BITMAP_TYPE_JPEG

    Load a JPEG image file.

    wx.BITMAP_TYPE_PCX

    Load a PCX image file.

    wx.BITMAP_TYPE_PNG

    Load a PNG image file.

    wx.BITMAP_TYPE_PNM

    Load a PNM image file.

    wx.BITMAP_TYPE_TIF

    Load a TIFF image file.

    wx.BITMAP_TYPE_XPM

    Load a XPM image file.

    wx.BITMAP_TYPE_ICO

    Load a Windows icon file (ICO).

    wx.BITMAP_TYPE_CUR

    Load a Windows cursor file (CUR).

    wx.BITMAP_TYPE_ANI

    Load a Windows animated cursor file (ANI).

    wx.BITMAP_TYPE_ANY

    Will try to autodetect the format.

  • index (int): Index of the image to load in the case that the image file contains multiple images. This is only used by GIF, ICO and TIFF handlers. The default value (-1) means to choose the default image and is interpreted as the first image (the one with index = 0) by the GIF and TIFF handler and as the largest and most colourful one by the ICO handler.


Returns:

wx.Image


AddHandler(handler)

Adds a handler to the end of the static list of format handlers.

Parameters:

  • handler (wx.ImageHandler): A new image format handler object. There is usually only one instance of a given handler class in an application session.

AdjustChannels(factor_red, factor_green, factor_blue, factor_alpha=1.0)

This function muliplies all 4 channels (red, green, blue, alpha) with a factor (around 1.0). Useful for gamma correction, colour correction and to add a certain amount of transparency to a image (fade in fade out effects). If factor_alpha is given but the original image has no alpha channel then a alpha channel will be added.

Parameters:

  • factor_red (double)
  • factor_green (double)
  • factor_blue (double)
  • factor_alpha (double)

Returns:

wx.Image


Blur(blurRadius)

Blurs the image in both horizontal and vertical directions by the specified pixel blurRadius. This should not be used when using a single mask colour for transparency.

Parameters:

  • blurRadius (int)

Returns:

wx.Image


BlurHorizontal(blurRadius)

Blurs the image in the horizontal direction only. This should not be used when using a single mask colour for transparency.

Parameters:

  • blurRadius (int)

Returns:

wx.Image

See also

Blur, BlurVertical


BlurVertical(blurRadius)

Blurs the image in the vertical direction only. This should not be used when using a single mask colour for transparency.

Parameters:

  • blurRadius (int)

Returns:

wx.Image

See also

Blur, BlurHorizontal


CanRead(filename)

Returns True if the image handlers can read this file.

Parameters:

  • filename (string)

Returns:

bool


CanReadStream(stream)

Returns True if the image handlers can read an image file from the data currently on the input stream, or a readable Python file-like object.

Parameters:


Returns:

bool


ComputeHistogram(histogram)

Computes the histogram of the image. histogram is a reference to wx.ImageHistogram object. wx.ImageHistogram is a specialization of wx.HashMap “template”.

Parameters:

  • histogram (wx.ImageHistogram)

Returns:

unsigned long


ConvertAlphaToMask(threshold=128)

If the image has alpha channel, this method converts it to mask. All pixels with alpha value less than threshold are replaced with mask colour and the alpha channel is removed. Mask colour is chosen automatically using FindFirstUnusedColour.

If the image image doesn’t have alpha channel, ConvertAlphaToMask does nothing.

Parameters:

  • threshold (int)

Returns:

bool


ConvertColourToAlpha(r, g, b)

This method converts an image where the original alpha information is only available as a shades of a colour (actually shades of grey) typically when you draw anti-aliased text into a bitmap. The DC drawing routines draw grey values on the black background although they actually mean to draw white with differnt alpha values. This method reverses it, assuming a black (!) background and white text. The method will then fill up the whole image with the colour given.

Parameters:

  • r (byte)
  • g (byte)
  • b (byte)

Returns:

bool


ConvertToBitmap(depth)

Convert the image to a wx.Bitmap.

Parameters:

  • depth (int)

Returns:

wx.Bitmap


ConvertToGreyscale(lr=0.299, lg=0.587, lb=0.114)

Returns a greyscale version of the image. The returned image uses the luminance component of the original to calculate the greyscale.

Defaults to using ITU-T BT.601 when converting to YUV, where every pixel equals (R * lr) + (G * lg) + (B * lb).

Parameters:

  • lr (double)
  • lg (double)
  • lb (double)

Returns:

wx.Image


ConvertToMono(r, g, b)

Returns monochromatic version of the image. The returned image has white colour where the original has (r, g, b) colour and black colour everywhere else.

Parameters:

  • r (byte)
  • g (byte)
  • b (byte)

Returns:

wx.Image


ConvertToMonoBitmap(r, g, b)

Returns a monochromatic wx.Bitmap version of the image. The returned image has white colour where the original has (r, g, b) colour and black colour everywhere else.

Parameters:

  • r (byte)
  • g (byte)
  • b (byte)

Returns:

wx.Bitmap


Copy()

Returns an identical copy of the image.


Returns:

wx.Image


CountColours()
No docstrings available for this method.

Create(width, height, clear=True)

Creates a fresh image. If clear is True, the new image will be initialized to black. Otherwise, the image data will be uninitialized.

Parameters:

  • width (int): The width of the image in pixels.
  • height (int): The height of the image in pixels.
  • clear (bool)

Returns:

bool


FindFirstUnusedColour(startR=1, startG=0, startB=0)

Finds the first colour that is never used in the image. The search begins at given initial colour and continues by increasing R, G and B components (in this order) by 1 until an unused colour is found or the colour space exhausted.

Returns a tuple consisting of a success flag and rgb values.

Parameters:

  • startR (int)
  • startG (int)
  • startB (int)

Returns:

(success, r, g, b)

Note

Note that this method involves computing the histogram, which is computationally intensive operation.


GetAlpha(x, y)

Returns the alpha value for the given pixel. This function may only be called for the images with alpha channel, use HasAlpha to check for this.

The returned value is the opacity of the image, i.e. the value of 0 corresponds to the fully transparent pixels while the value of 255 to the fully opaque pixels.

Parameters:

  • x (int)
  • y (int)

Returns:

byte


GetAlphaBuffer()

Returns a writable Python buffer object that is pointing at the Alpha data buffer inside the wx.Image. You need to ensure that you do not use this buffer object after the image has been destroyed.


Returns:

PyObject


GetAlphaData()

Returns a string containing a copy of the alpha bytes of the image.


Returns:

PyObject


GetBlue(x, y)

Returns the blue intensity at the given coordinate.

Parameters:

  • x (int)
  • y (int)

Returns:

byte


GetData()

Returns the image data as an array. This is most often used when doing direct image manipulation. The return value points to an array of characters in RGBRGBRGB... format in the top-to-bottom, left-to-right order, that is the first RGB triplet corresponds to the pixel first pixel of the first row, the second one — to the second pixel of the first row and so on until the end of the first row, with second row following after it and so on.

You should not delete the returned pointer nor pass it to SetData.


Returns:

unsigned string


GetDataBuffer()

Returns a writable Python buffer object that is pointing at the RGB image data buffer inside the wx.Image. You need to ensure that you do not use this buffer object after the image has been destroyed.


Returns:

PyObject


GetGreen(x, y)

Returns the green intensity at the given coordinate.

Parameters:

  • x (int)
  • y (int)

Returns:

byte


GetHandlers()

Returns the static list of image format handlers.


Returns:

list of objects

See also

wx.ImageHandler


GetHeight()

Gets the height of the image in pixels.


Returns:

int


GetImageCount()

If the image file contains more than one image and the image handler is capable of retrieving these individually, this function will return the number of available images.


Returns:

int


GetImageExtWildcard()

Iterates all registered wx.ImageHandler objects, and returns a string containing file extension masks suitable for passing to file open/save dialog boxes.


Returns:

string

See also

wx.ImageHandler


GetMaskBlue()

Gets the blue value of the mask colour.


Returns:

int


GetMaskGreen()

Gets the green value of the mask colour.


Returns:

int


GetMaskRed()

Gets the red value of the mask colour.


Returns:

int


GetOption(name)

Gets a user-defined option. The function is case-insensitive to name.

For example, when saving as a JPEG file, the option quality is used, which is a number between 0 and 100 (0 is terrible, 100 is very good).

Parameters:

  • name (string)

Returns:

string


GetOptionInt(name)

Gets a user-defined option as an integer. The function is case-insensitive to name. If the given option is not present, the function returns 0. Use HasOption is 0 is a possibly valid value for the option.

Options for wx.PNGHandler:

Option Constant Description
wx.IMAGE_OPTION_PNG_FORMAT Format for saving a PNG file.
wx.IMAGE_OPTION_PNG_BITDEPTH Bit depth for every channel (R/G/B/A).

Supported values for wx.IMAGE_OPTION_PNG_FORMAT:

wx.PNG_TYPE_COLOUR Stores RGB image.
wx.PNG_TYPE_GREY Stores grey image, converts from RGB.
wx.PNG_TYPE_GREY_RED Stores grey image, uses red value as grey.

Parameters:

  • name (string)

Returns:

int

See also

SetOption, GetOption


GetOrFindMaskColour()

Get the current mask colour or find a suitable unused colour that could be used as a mask colour.

Returns True if the image currently has a mask.


Returns:

bool


GetRed(x, y)

Returns the red intensity at the given coordinate.

Parameters:

  • x (int)
  • y (int)

Returns:

byte


GetSize()

Returns the size of the image in pixels.


Returns:

wx.Size


GetSubImage(rect)

Returns a sub image of the current one as long as the rect belongs entirely to the image.

Parameters:


Returns:

wx.Image


GetWidth()

Gets the width of the image in pixels.


Returns:

int

See also

GetHeight


HSVtoRGB(hsv)

Converts a color in HSV color space to RGB color space.

Parameters:


Returns:

wx.Image_RGBValue


HasAlpha()

Returns True if this image has alpha channel, False otherwise.


Returns:

bool

See also

GetAlpha, SetAlpha


HasMask()

Returns True if there is a mask active, False otherwise.


Returns:

bool


HasOption(name)

Returns True if the given option is present. The function is case-insensitive to name.

Parameters:

  • name (string)

Returns:

bool


InitAlpha()
Initializes the image alpha channel data. It is an error to call it if the image already has alpha data. If it doesn’t, alpha data will be by default initialized to all pixels being fully opaque. But if the image has a a mask colour, all mask pixels will be completely transparent.

InsertHandler(handler)

Adds a handler at the start of the static list of format handlers.

Parameters:

  • handler (wx.ImageHandler): A new image format handler object. There is usually only one instance of a given handler class in an application session.

See also

wx.ImageHandler


IsOk()

Returns True if image data is present.


Returns:

bool


IsTransparent(x, y, threshold=128)

Returns True if the given pixel is transparent, i.e. either has the mask colour if this image has a mask or if this image has alpha channel and alpha value of this pixel is strictly less than threshold.

Parameters:

  • x (int)
  • y (int)
  • threshold (int)

Returns:

bool


LoadFile(name, type=wx.BITMAP_TYPE_ANY, index=-1)

Loads an image from an input stream.

Parameters:

  • name (string): Name of the file from which to load the image.

  • type (int): One of the following values:

    Bitmap Type Constant

    Description

    wx.BITMAP_TYPE_BMP

    Load a Windows image file.

    wx.BITMAP_TYPE_GIF

    Load a GIF image file.

    wx.BITMAP_TYPE_JPEG

    Load a JPEG image file.

    wx.BITMAP_TYPE_PCX

    Load a PCX image file.

    wx.BITMAP_TYPE_PNG

    Load a PNG image file.

    wx.BITMAP_TYPE_PNM

    Load a PNM image file.

    wx.BITMAP_TYPE_TIF

    Load a TIFF image file.

    wx.BITMAP_TYPE_XPM

    Load a XPM image file.

    wx.BITMAP_TYPE_ICO

    Load a Windows icon file (ICO).

    wx.BITMAP_TYPE_CUR

    Load a Windows cursor file (CUR).

    wx.BITMAP_TYPE_ANI

    Load a Windows animated cursor file (ANI).

    wx.BITMAP_TYPE_ANY

    Will try to autodetect the format.

  • index (int): Index of the image to load in the case that the image file contains multiple images. This is only used by GIF, ICO and TIFF handlers. The default value (-1) means to choose the default image and is interpreted as the first image (the one with index = 0) by the GIF and TIFF handler and as the largest and most colourful one by the ICO handler


Returns:

bool

Note

Depending on how wxWidgets has been configured, not all formats may be available.

Note

you can use GetOptionInt to set the hotspot before saving an image into a cursor file (default hotspot is in the centre of the image):

hotspot_x = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X)
hotspot_y = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y)

See also

SaveFile


LoadMimeFile(name, mimetype, index=-1)

Loads an image from a file, specifying the image type with a MIME type string.

Parameters:

  • name (string)
  • mimetype (string)
  • index (int)

Returns:

bool


LoadMimeStream(stream, mimetype, index=-1)

Loads an image from an input stream or a readable Python file-like object, using a MIME type string to specify the image file format.

Parameters:


Returns:

bool


LoadStream(stream, type=wx.BITMAP_TYPE_ANY, index=-1)

Loads an image from an input stream or a readable Python file-like object. If no handler type is provided, the library will try to autodetect the format.

Parameters:


Returns:

bool


Mirror(horizontally=True)

Returns a mirrored copy of the image. The parameter horizontally indicates the orientation.

Parameters:

  • horizontally (bool)

Returns:

wx.Image


Paste(image, x, y)

Pastes image into this instance and takes care of the mask colour and any out of bounds problems.

Parameters:


RGBtoHSV(rgb)

Converts a color in RGB color space to HSV color space.

Parameters:


Returns:

wx.Image_HSVValue


RemoveHandler(name)

Finds the handler with the given name, and removes it. The handler is not deleted.

Parameters:

  • name (string): The handler name.

Returns:

bool

See also

wx.ImageHandler


Replace(r1, g1, b1, r2, g2, b2)

Replaces the colour specified by r1, g1, b1 by the colour r2, g2, b2.

Parameters:

  • r1 (int)
  • g1 (int)
  • b1 (int)
  • r2 (int)
  • g2 (int)
  • b2 (int)

ResampleBicubic(width, height)

Parameters:

  • width (int)
  • height (int)

Returns:

wx.Image


ResampleBox(width, height)

Parameters:

  • width (int)
  • height (int)

Returns:

wx.Image


Rescale(width, height, quality=wx.IMAGE_QUALITY_NORMAL)

Changes the size of the image in-place by scaling it: after a call to this function, the image will have the given width and height. For a description of the quality parameter, see the Scale function.

Returns the (modified) image itself.

Parameters:

  • width (int)
  • height (int)
  • quality (int)

Returns:

wx.Image

See also

Scale


Resize(size, pos, red=-1, green=-1, blue=-1)

Changes the size of the image in-place without scaling it by adding either a border with the given colour or cropping as necessary. The image is pasted into a new image with the given size and background colour at the position pos relative to the upper left of the new image. If red = green = blue = -1 then use either the current mask colour if set or find, use, and set a suitable mask colour for any newly exposed areas.

Returns the (modified) image itself.

Parameters:


Returns:

wx.Image

See also

Size


Rotate(angle, centre_of_rotation, interpolating=True, offset_after_rotation=None)

Rotates the image about the given point, by angle radians. Passing True to interpolating results in better image quality, but is slower. If the image has a mask, then the mask colour is used for the uncovered pixels in the rotated image background. Else, black RGB(0, 0, 0) will be used.

Returns the rotated image, leaving this image intact.

Parameters:

  • angle (double)
  • centre_of_rotation (wx.Point)
  • interpolating (bool)
  • offset_after_rotation (wx.Point)

Returns:

wx.Image


Rotate90(clockwise=True)

Returns a copy of the image rotated 90 degrees in the direction indicated by clockwise.

Parameters:

  • clockwise (bool)

Returns:

wx.Image


RotateHue(angle)

Rotates the hue of each pixel in the image by angle, which is a double in the range of -1.0 to +1.0, where -1.0 corresponds to -360 degrees and +1.0 corresponds to +360 degrees.

Parameters:

  • angle (double)

SaveFile(name, type)

Saves an image in the given stream.

Parameters:

  • name (string): Name of the file to save the image to.

  • type (int): Currently these types can be used:

    Bitmap Type Constant

    Description

    wx.BITMAP_TYPE_BMP

    Save a Windows image file.

    wx.BITMAP_TYPE_JPEG

    Save a JPEG image file.

    wx.BITMAP_TYPE_PCX

    Save a PCX image file.

    wx.BITMAP_TYPE_PNG

    Save a PNG image file.

    wx.BITMAP_TYPE_PNM

    Save a PNM image file.

    wx.BITMAP_TYPE_TIFF

    Save a TIFF image file.

    wx.BITMAP_TYPE_XPM

    Save a XPM image file.

    wx.BITMAP_TYPE_ICO

    Save a Windows icon file (ICO).

    wx.BITMAP_TYPE_CUR

    Save a Windows cursor file (CUR).


Returns:

bool

Note

Depending on how wxWidgets has been configured, not all formats may be available.

Note

you can use GetOptionInt to set the hotspot before saving an image into a cursor file (default hotspot is in the centre of the image):

hotspot_x = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X)
hotspot_y = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y)

See also

LoadFile


SaveMimeFile(name, mimetype)

Saves an image in the named file.

Parameters:

  • name (string)
  • mimetype (string)

Returns:

bool


SaveMimeStream(stream, mimetype)

Saves an image in the named file.

Parameters:


Returns:

bool


SaveStream(stream, type)

Saves an image in the named file.

Parameters:


Returns:

bool


Scale(width, height, quality)

Returns a scaled version of the image. This is also useful for scaling bitmaps in general as the only other way to scale bitmaps is to blit a wx.MemoryDC into another wx.MemoryDC.

It should be noted that although using wx.IMAGE_QUALITY_HIGH produces much nicer looking results it is a slower method. Downsampling will use the box averaging method which seems to operate very fast. If you are upsampling larger images using this method you will most likely notice that it is a bit slower and in extreme cases it will be quite substantially slower as the bicubic algorithm has to process a lot of data.

It should also be noted that the high quality scaling may not work as expected when using a single mask colour for transparency, as the scaling will blur the image and will therefore remove the mask partially. Using the alpha channel will work.

Example:

# Get the bitmap from somewhere
bmp = wx.Bitmap("MyBitmap.png", wx.BITMAP_TYPE_PNG)

# rescale it to have size of 32*32
if bmp.GetWidth() != 32 or bmp.GetHeight() != 32:
    image = bmp.ConvertToImage()
    bmp = wx.BitmapFromImage(image.Scale(32, 32))

    # another possibility:
    image.Rescale(32, 32)
    bmp = image

Parameters:

  • width (int): The desired width

  • height (int): The desired height

  • quality (int): Determines what method to use for resampling the image. Can be one of the following:

    Quality Flag

    Description

    wx.IMAGE_QUALITY_NORMAL

    Uses the normal default scaling method of pixel replication

    wx.IMAGE_QUALITY_HIGH

    Uses bicubic and box averaging resampling methods for upsampling and downsampling respectively


Returns:

wx.Image

See also

Rescale


SetAlpha(x, y, alpha)

Sets the alpha value for the given pixel. This function should only be called if the image has alpha channel data, use HasAlpha to check for this.

Parameters:

  • x (int)
  • y (int)
  • alpha (byte)

SetAlphaBuffer(alpha)

Sets the internal image alpha pointer to point at a Python buffer object. This can save making an extra copy of the data but you must ensure that the buffer object lives as long as the wx.Image does.

Parameters:

  • alpha (buffer)

SetAlphaData(alpha)

Resets the Image’s alpha data from a buffer of bytes. Accepts either a string or a buffer object holding the data and the length of the data must be width*height.

Parameters:

  • alpha (buffer)

SetData(data)

Sets the image data without performing checks. The data given must have the size (width*height*3) or results will be unexpected. Don’t use this method if you aren’t sure you know what you are doing.

After this call the pointer to the data is owned by the wx.Image object, that will be responsible for deleting it. Do not pass to this function a pointer obtained through GetData.

Parameters:

  • data (unsigned string)

SetDataBuffer(data)

Sets the internal image data pointer to point at a Python buffer object. This can save making an extra copy of the data but you must ensure that the buffer object lives longer than the wx.Image does.

Parameters:

  • data (buffer)

SetMask(hasMask=True)

Specifies whether there is a mask or not. The area of the mask is determined by the current mask colour.

Parameters:

  • hasMask (bool)

SetMaskColour(red, green, blue)

Sets the mask colour for this image (and tells the image to use the mask).

Parameters:

  • red (byte)
  • green (byte)
  • blue (byte)

SetMaskFromImage(mask)

Sets the image’s mask so that the pixels that have RGB value of (mr, mg, mb) in mask will be masked in this image.

This is done by first finding an unused colour in the image, setting this colour as the mask colour and then using this colour to draw all pixels in the image who corresponding pixel in mask has given RGB value.

Returns False if mask does not have same dimensions as the image or if there is no unused colour left. Returns True if the mask was successfully applied.

Parameters:

  • mask (wx.Image): The mask image to extract mask shape from. Must have same dimensions as the image.

Returns:

bool

Note

Note that this method involves computing the histogram, which is computationally intensive operation.


SetOption(name, value)

Sets a user-defined option. The function is case-insensitive to name.

For example, when saving as a JPEG file, the option quality is used, which is a number between 0 and 100 (0 is terrible, 100 is very good).

Parameters:

  • name (string)
  • value (string)

SetOptionInt(name, value)

Sets an image option as an integer.

Parameters:

  • name (string)
  • value (int)

SetRGB(rect, red, green, blue)

Sets the colour of the pixels within the given rectangle. This routine performs bounds-checks for the coordinate so it can be considered a safe way to manipulate the data.

Parameters:

  • rect (wx.Rect)
  • red (int)
  • green (int)
  • blue (int)

SetRGBRect(rect, r, g, b)

Sets the colour of the pixels within the given rectangle. This routine performs bounds-checks for the rectangle so it can be considered a safe way to manipulate the data.

Parameters:

  • rect (wx.Rect)
  • r (byte)
  • g (byte)
  • b (byte)

ShrinkBy(xFactor, yFactor)

Return a version of the image scaled smaller by the given factors.

Parameters:

  • xFactor (int)
  • yFactor (int)

Returns:

wx.Image


Size(size, pos, red=-1, green=-1, blue=-1)

Returns a resized version of this image without scaling it by adding either a border with the given colour or cropping as necessary.

The image is pasted into a new image with the given size and background colour at the position pos relative to the upper left of the new image. If red = green = blue = -1 then use either the current mask colour if set or find, use, and set a suitable mask colour for any newly exposed areas.

Returns the (modified) image itself.

Parameters:


Returns:

wx.Image

See also

Resize


Properties

AlphaBuffer
See GetAlphaBuffer and SetAlphaBuffer
AlphaData
See GetAlphaData and SetAlphaData
Data
See GetData and SetData
DataBuffer
See GetDataBuffer and SetDataBuffer
Height
See GetHeight
MaskBlue
See GetMaskBlue
MaskGreen
See GetMaskGreen
MaskRed
See GetMaskRed
Width
See GetWidth