I am working on a picture editing tool in which I need to merge two images. Most of the image editing tools like gimp use PorterDuff modes for merging or blending images. I am also using the same approach in android.
As android provides limited number of PorterDuff modes, I am not able to achieve the desired result. So, I am thinking of implementing PorterDuff modes(Overlapping, Hard-Light, Soft-Light, Color-burn, Color-dodge) which are not included in android.
The problem is I don’t know where to start. So, any reference or guidance in this regard will be highly appreciated.
I am working on a picture editing tool in which I need to merge
Share
This is how you can implement the Overlay PorterDuff mode in android:
Note: While extracting the bitmaps set the configuration to be ARGB_8888 and this is important.
Any time you want to do image blending or color manipulation, you need to make sure you are in ARGB_8888 mode, not in RGB_565 mode. Up until 2.3, android will usully default to RGB_565 mode unless you explicitly tell it to do otherwise in order to save memory.