Android Image Processing Library

I am working on a small android application and I want to work on images like sketch, monochrome, sepia, charcoal, oil paint, negative, Flip, flop, emboss effect, etc. on the image, as well as change the hue, brightness, contrast, sharpness of the image. Is there an Android library for such a tool. I really appreciate any help.

+8
android imagemagick image-editing
source share
4 answers

try this library

Jjil

+4
source share

Use the following code to add contrast to the bitmap: the value can vary from 1 to 100

public static Bitmap AdjustContrast(Bitmap original, float Value){ Value = (100.0f + Value) / 100.0f; Value *= Value; Bitmap newBitmap = Bitmap.createBitmap(original.getWidth(), original.getHeight(),original.getConfig()); int[] argb = new int[original.getWidth() * original.getHeight()]; original.getPixels(argb, 0, original.getWidth(), 0, 0, original.getWidth(), original.getHeight()); for (int i = argb.length - 1; i >= 0; --i) { int alpha = argb[i] >> 24; int red = (argb[i] >> 16) & 0xFF; int green = (argb[i] >> 8) & 0xFF; int blue = argb[i] & 0xFF; float Red = red / 255.0f; float Green = green / 255.0f; float Blue = blue / 255.0f; Red = (((Red - 0.5f) * Value) + 0.5f) * 255.0f; Green = (((Green - 0.5f) * Value) + 0.5f) * 255.0f; Blue = (((Blue - 0.5f) * Value) + 0.5f) * 255.0f; int iR = (int)Red; iR = iR > 255 ? 255 : iR; iR = iR < 0 ? 0 : iR; int iG = (int)Green; iG = iG > 255 ? 255 : iG; iG = iG < 0 ? 0 : iG; int iB = (int)Blue; iB = iB > 255 ? 255 : iB; iB = iB < 0 ? 0 : iB; int composite = (alpha << 24) | (iR << 16) | (iG << 8) | iB; argb[i] = composite; } newBitmap.setPixels(argb, 0, original.getWidth(), 0, 0, original.getWidth(), original.getHeight()); Store.lastBitmap = newBitmap; return newBitmap; } 

Use this for luminance effect: value should be from 1 to 100

 public static Bitmap makeBrightnessBitmap(Bitmap original, int brightness){ Bitmap newBitmap = Bitmap.createBitmap(original.getWidth(), original.getHeight(),original.getConfig()); int[] argb = new int[original.getWidth() * original.getHeight()]; original.getPixels(argb, 0, original.getWidth(), 0, 0, original.getWidth(), original.getHeight()); for (int i = argb.length - 1; i >= 0; --i) { int alpha = argb[i] >> 24; int red = (argb[i] >> 16) & 0xFF; int green = (argb[i] >> 8) & 0xFF; int blue = argb[i] & 0xFF; int red2 = red + brightness; if (red2>0xFF) red2 = 0xFF; if (red2<0) red2 = 0; int green2 = green + brightness; if (green2>0xFF) green2 = 0xFF; if (green2<0) green2 = 0; int blue2 = blue + brightness; if (blue2>0xFF) blue2 = 0xFF; if (blue2<0) blue2 = 0; int composite = (alpha << 24) | (red2 << 16) | (green2 << 8) | blue2; argb[i] = composite; } newBitmap.setPixels(argb, 0, original.getWidth(), 0, 0, original.getWidth(), original.getHeight()); Store.lastBitmap = newBitmap; return newBitmap; } 
+1
source share

Basic image effects can be achieved with standard Android tools. Take a look at the android.graphics packages (and they work with native image formats and bitmap images).

0
source share

Use the Aviary SDK. It supports iOS and Android phones. Here is the official link: http://www.aviary.com/android

You will find the full code at this link: https://github.com/AviaryInc/Mobile-Feather-SDK-for-Android

Good luck for your application.

0
source share

All Articles