- copyImagevoid copyImage(Image source, uint destX, uint destY, IntRect sourceRect, bool applyAlpha) 
- Copy pixels from another image onto this one. 
- createvoid create(uint width, uint height, Color color) 
- Create the image and fill it with a unique color. 
- createvoid create(uint width, uint height, ubyte[] pixels) 
- Create the image from an array of pixels. 
- createMaskFromColorvoid createMaskFromColor(Color maskColor, ubyte alpha) 
- Create a transparency mask from a specified color-key. 
- flipHorizontallyvoid flipHorizontally() 
- Flip the image horizontally (left <-> right) 
- flipVerticallyvoid flipVertically() 
- Flip the image vertically (top <-> bottom) 
- getPixelColor getPixel(uint x, uint y) 
- getPixelArrayconst(ubyte)[] getPixelArray() 
- Get the read-only array of pixels that make up the image. 
- getSizeVector2u getSize() 
- Return the size (width and height) of the image. 
- loadFromFilebool loadFromFile(string fileName) 
- Load the image from a file on disk. 
- loadFromMemorybool loadFromMemory(const(void)[] data) 
- Load the image from a file in memory. 
- loadFromStreambool loadFromStream(InputStream stream) 
- Load the image from a custom stream. 
- saveToFilebool saveToFile(string fileName) 
- Save the image to a file on disk. 
- setPixelvoid setPixel(uint x, uint y, Color color) 
- Change the color of a pixel. 
Class for loading, manipulating and saving images.
Image is an abstraction to manipulate images as bidimensional arrays of pixels.
The class provides functions to load, read, write and save pixels, as well as many other useful functions.
Image can handle a unique internal representation of pixels, which is RGBA 32 bits. This means that a pixel must be composed of 8 bits red, green, blue and alpha channels – just like a Color. All the functions that return an array of pixels follow this rule, and all parameters that you pass to Image functions (such as loadFromPixels) must use this representation as well.
A Image can be copied, but it is a heavy resource and if possible you should always use const references to pass or return them to avoid useless copies.