Creates an empty Image with the same dimensions of this image.
Creates an empty Image with the same dimensions of this image.
a new Image that is a clone of this image but with uninitialized data
Creates a new image with the same data as this image.
Creates a new image with the same data as this image. Any operations to the copied image will not write back to the original.
A copy of this image.
the height of the image
Returns the pixels of the image as an iterator.
Returns the pixels of the image as an iterator. The iterator is the most efficient way to lazily iterator over the pixels as the pixels will only be fetched from the raster as needed.
the iterator
Creates a new image which is the result of this image padded to the canvas size specified.
Creates a new image which is the result of this image padded to the canvas size specified. If this image is already larger than the specified pad then the sizes of the existing image will be used instead.
Eg, requesting a pad of 200,200 on an image of 250,300 will result in keeping the 250,300.
Eg2, requesting a pad of 300,300 on an image of 400,250 will result in the width staying at 400 and the height padded to 300.
the size of the output canvas width
the size of the output canvas height
the background of the padded area.
A new image that is the result of the padding
Returns the pixel at the given coordinates.
Returns the pixel at the given coordinates.
the x coordinate of the pixel to grab
the y coordinate of the pixel to grab
the Pixel at the location
Scale will resize the canvas and scale the image to match.
Scale will resize the canvas and scale the image to match. This is like a "image resize" in Photoshop.
the target width
the target width
the type of scaling method to use.
a new Image that is the result of scaling this image
the width of the image
Returns the ARGB components for all pixels in this image
Returns the ARGB components for all pixels in this image
an array containing ARGB components in that order.
Returns the ARGB components for the pixel at the given coordinates
Returns the ARGB components for the pixel at the given coordinates
the x coordinate of the pixel component to grab
the y coordinate of the pixel component to grab
an array containing ARGB components in that order.
Returns the centre coordinates for the image.
Returns the centre coordinates for the image.
Returns the color at the given coordinates.
Returns the color at the given coordinates.
the RGBColor value at the coords
Returns a set of the distinct colours used in this image.
Returns a set of the distinct colours used in this image.
the set of distinct Colors
Returns true if a pixel with the given color exists.
Returns true if a pixel with the given color exists.
the pixel colour to look for.
true if there exists at least one pixel that has the given pixels color
Counts the number of pixels that are true for the given predicate
Counts the number of pixels that are true for the given predicate
a predicate
the number of pixels that evaluated true
Counts the number of pixels with the given colour.
Counts the number of pixels with the given colour.
the colour to detect.
the number of pixels that matched the colour of the given pixel
Returns the number of pixels in the image.
Returns true if the predicate holds on the image
Returns true if the predicate holds on the image
a predicate
true if p holds for at least one pixel
Creates a new image which is the result of this image padded with the given number of pixels on each edge.
Creates a new image which is the result of this image padded with the given number of pixels on each edge.
Eg, requesting a pad of 30 on an image of 250,300 will result in a new image with a canvas size of 310,360
the number of pixels to add on each edge
the background of the padded area.
A new image that is the result of the padding
Returns the pixel at the given coordinate.
Returns the pixel at the given coordinate.
the pixel as an integer tuple
the pixel
Returns a rectangular region within the given boundaries as a single dimensional array of integers.
Returns a rectangular region within the given boundaries as a single dimensional array of integers.
Eg, pixels(10, 10, 30, 20) would result in an array of size 600 with the first row of the region in indexes 0,..,29, second row 30,..,59 etc.
the start x coordinate
the start y coordinate
the width of the region
the height of the region
an Array of pixels for the region
Returns all the pixels for the image
Returns all the pixels for the image
an array of pixels for this image
Returns the aspect ratio for this image.
Resize will resize the canvas, it will not scale the image.
Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.
the scaleFactor. 1 retains original size. 0.5 is half. 2 double. etc
where to position the original image after the canvas size change. Defaults to centre.
the color to use for expande background areas. Defaults to White.
a new Image that is the result of resizing the canvas.
Resize will resize the canvas, it will not scale the image.
Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.
where to position the original image after the canvas size change
a new Image that is the result of resizing the canvas.
Resize will resize the canvas, it will not scale the image.
Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.
where to position the original image after the canvas size change
a new Image that is the result of resizing the canvas.
Scale will resize the canvas and the image.
Scale will resize the canvas and the image. This is like a "image resize" in Photoshop.
the target increase or decrease. 1 is the same as original.
the type of scaling method to use.
a new Image that is the result of scaling this image
Scale will resize the canvas and scale the image to match.
Scale will resize the canvas and scale the image to match. This is like a "image resize" in Photoshop.
This overloaded version of scale will scale the image so that the new image has a height that matches the given targetHeight and the same aspect ratio as the original.
Eg, an image of 200,300 with a scaleToHeight of 450 will result in a scaled image of 300,450
the target height
the type of scaling method to use.
a new Image that is the result of scaling this image
Scale will resize the canvas and scale the image to match.
Scale will resize the canvas and scale the image to match. This is like a "image resize" in Photoshop.
This overloaded version of scale will scale the image so that the new image has a width that matches the given targetWidth and the same aspect ratio as the original.
Eg, an image of 200,300 with a scaleToWidth of 400 will result in a scaled image of 400,600
the target width
the type of scaling method to use.
a new Image that is the result of scaling this image
Operations that (can) change the size of the canvas and so require a new backing buffer.