I am trying to blend two images the same way photoshop or paint.net blend them, with different blend modes like Difference, Multiply, Additive, Color Burn, Glow, etc.
I have found that PorterDuff.Mode
works quite well, but it lacks blending effects ( it only has Add, Multiply, screen) is there a way to get a bigger range of blend modes? Is there a way to edit the android.graphics.PorterDuff;
library to get more blend modes?
Any ideas?
For example: THIS turns into this: Result
This is the porterduff code im using btw:
private static Bitmap Result(Bitmap bottomImage, Bitmap topImage){
int sizex = bottomImage.getWidth();
int sizey = bottomImage.getHeight();
Paint paint = new Paint();
Bitmap imageBitmap = Bitmap.createBitmap(sizex, sizey , Bitmap.Config.ARGB_8888);
Canvas comboImage = new Canvas(imageBitmap);
comboImage.drawBitmap(bottomImage, 0f, 0f, paint);;
PorterDuff.Mode mode = PorterDuff.Mode.MULTIPLY;//Porterduff MODE
paint.setXfermode(new PorterDuffXfermode(mode));
Bitmap ScaledtopImage = Bitmap.createScaledBitmap(topImage, sizex, sizey, false);
comboImage.drawBitmap(ScaledtopImage, 0f, 0f, paint);
return imageBitmap;
}