Code example for ColorMatrix

Methods: setScale

	public static Bitmap lum(Bitmap bitmap, int lumValue){
		float newlumValue = lumValue * 1.0F / 127;
		ColorMatrix lumColorMatrix = new ColorMatrix();
		lumColorMatrix.setScale(newlumValue, newlumValue, newlumValue, 1);
		Paint paint = new Paint();
		paint.setColorFilter(new ColorMatrixColorFilter(lumColorMatrix));
		Bitmap newBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
		Canvas canvas = new Canvas(newBitmap);
		canvas.drawBitmap(bitmap, 0, 0, paint);
		return newBitmap;
Connect your IDE to all the code out there  Get Codota for Java