fun getColor(x: Int, y: Int): Int

Returns pixel at (x, y) as unpremultiplied color. Returns black with alpha if ColorType is ColorType.ALPHA_8.

Input is not validated: out of bounds values of x or y returns undefined values or may crash if. Fails if ColorType is ColorType.UNKNOWN or pixel address is nullptr.

ColorSpace in ImageInfo is ignored. Some color precision may be lost in the conversion to unpremultiplied color; original pixel data may have additional precision.


pixel converted to unpremultiplied color



column index, zero or greater, and less than getWidth()


row index, zero or greater, and less than getHeight()