# class Image

#### package lime.graphics

Available on all platforms

### Constructor

###

`new (?buffer:ImageBuffer, offsetX:Int = 0, offsetY:Int = 0, width:Int = -1, height:Int = -1, ?color:Int, ?type:ImageType)`

### Variables

###

`buffer:ImageBuffer`

###

`data:UInt8Array`

###

`dirty:Bool`

###

`format:PixelFormat`

###

`height:Int`

###

`offsetX:Int`

###

`offsetY:Int`

###

`powerOfTwo:Bool`

###

`premultiplied:Bool`

###

`read onlyrect:Rectangle`

###

`src:Dynamic`

###

`transparent:Bool`

###

`type:ImageType`

###

`version:Int`

###

`width:Int`

###

`x:Float`

###

`y:Float`

### Methods

###

`clone ():Image`

###

`colorTransform (rect:Rectangle, colorMatrix:ColorMatrix):Void`

###

`copyChannel (sourceImage:Image, sourceRect:Rectangle, destPoint:Vector2, sourceChannel:ImageChannel, destChannel:ImageChannel):Void`

###

`copyPixels (sourceImage:Image, sourceRect:Rectangle, destPoint:Vector2, ?alphaImage:Image, ?alphaPoint:Vector2, mergeAlpha:Bool = false):Void`

###

`encode (format:String = "png", quality:Int = 90):Bytes`

###

`fillRect (rect:Rectangle, color:Int, ?format:PixelFormat):Void`

###

`floodFill (x:Int, y:Int, color:Int, ?format:PixelFormat):Void`

###

`getColorBoundsRect (mask:Int, color:Int, findColor:Bool = true, ?format:PixelFormat):Rectangle`

###

`getPixel (x:Int, y:Int, ?format:PixelFormat):Int`

###

`getPixel32 (x:Int, y:Int, ?format:PixelFormat):Int`

###

`getPixels (rect:Rectangle, ?format:PixelFormat):Bytes`

###

`merge (sourceImage:Image, sourceRect:Rectangle, destPoint:Vector2, redMultiplier:Int, greenMultiplier:Int, blueMultiplier:Int, alphaMultiplier:Int):Void`

###

`resize (newWidth:Int, newHeight:Int):Void`

###

`scroll (x:Int, y:Int):Void`

###

`setPixel (x:Int, y:Int, color:Int, ?format:PixelFormat):Void`

###

`setPixel32 (x:Int, y:Int, color:Int, ?format:PixelFormat):Void`

###

`setPixels (rect:Rectangle, bytePointer:BytePointer, ?format:PixelFormat, ?endian:Endian):Void`

###

`threshold (sourceImage:Image, sourceRect:Rectangle, destPoint:Vector2, operation:String, threshold:Int, color:Int = 0x00000000, mask:Int = 0xFFFFFFFF, copySource:Bool = false, ?format:PixelFormat):Int`

### Static methods

###

`staticfromBase64 (base64:String, type:String):Image`

###

`staticfromBitmapData (bitmapData:Dynamic):Image`

Available on Android, HTML5, iOS, Linux, macOS, Neko, Windows

###

`staticfromBitmapData (bitmapData:BitmapData):Image`

Available on Flash

###

`staticfromBytes (bytes:Bytes):Image`

###

`staticfromCanvas (canvas:Dynamic):Image`

Available on Android, Flash, iOS, Linux, macOS, Neko, Windows

###

`staticfromCanvas (canvas:CanvasElement):Image`

Available on HTML5

###

`staticfromFile (path:String):Image`

###

`staticfromImageElement (image:Dynamic):Image`

Available on Android, Flash, iOS, Linux, macOS, Neko, Windows

###

`staticfromImageElement (image:ImageElement):Image`

Available on HTML5

###

`staticloadFromBase64 (base64:String, type:String):Future<Image>`

###

`staticloadFromBytes (bytes:Bytes):Future<Image>`

###

`staticloadFromFile (path:String):Future<Image>`