imageprocessing (android)

Contains functions for image processing.

You can apply effect in two ways:

  1. Pass BitmapValue and parameters array. The result will be a BitmapValue. bitmap = boxBlur(bitmap, [20, 40])
  2. Pass width, height, pixels array and parameters array. The result will be an array [width, height, pixels]. extract(width, height, pixels) = boxBlur(w, h, pixels, [20, 40])

Functions

boxBlur(horizontalBlur = 10 (min 1, max 100), verticalBlur = 10 (min 1, max 100)) — applies quick blur effect

contrast(level = 40 (min -100, max 100)) — changes contrast of the image

decolour() — converts color image to grayscale

edgeDetection(operator = 1, mode = 0) — applies edge detection effect.

operator 0 - Roberts, 1 - Prewitt, 2 - Sobel, 3 - Scharr
mode 0 - color edges, 1 - gray edges, 2 - subtract edges

emboss(azimuth = 45 (min 0, max 360), elevation = 45 (min 0, max 90), edgeHeight = 140 (min 0, max 256), edgeThickness = 80 (min 2, max 100), emboss = 0 (min 0, max 1)) — applies emboss effect

extractChannel(channel = 0, monochrome = 0) — extracts given channel from image.

channel 0 - red, 1 - green, 2 - blue
monochrome 0 - off, 1 - on

gamma(level = 20 (min -50, max 50)) — changes gamma of the image

hsbCorrection(hue = 45 (min 0, max 360), saturation = 0 (min -100, max 100), brightness = 0 (min -100, max 100), tone = 0 (min 0, max 1)) — changes hue, saturation and brightness of the image

invert(invertAlpha = 0, invertRed = 1, invertGreen = 2, invertBlue = 3) — inverts channels of the image

monochrome(level = 128 (min 0, max 255)) — converts color image to monochrome

mosaic(size = 4 (min 1, max 50)) — applies mosaic effect

noiseGeneration(amount = 50 (min 0, max 255), monochrome = 0) — adds noise to images

posterization(level = 64 (min 1, max 255)) — applies posterization effect

rgbCorrection(alpha = 0 (min -255, max 255), red = 0 (min -255, max 255), green = 0 (min -255, max 255), blue = 0 (min -255, max 255)) — changes alpha, red, green and blue channels of the image

rotate(angle = 45 (min 0, max 360)) — rotates image

saturation(level = 64 (min -255, max 255)) — changes saturation of the image

scatter(horizontalScatter = 10 (min 1, max 100), verticalScatter = 10 (min 1, max 100)) — applies pixel scatter effect

smooth(level = 3 (min 1, max 25)) — applies smooth effect

xor(level = 64 (min 0, max 255)) — applies xor operation for each pixel of the image