Blend algorithm
in
Programming Questions
•
3 years ago
I am trying to develop a more versatile blending algorithm.
I am currently using Processing blend (...,ADD) function.
Basically I would like to write an algorithm which accepts two images and blends them together without having a grey cast due to the overlapping alpha values.
For example:
- void newblend(PImage src1, PImage src2){
- PImage _src1 = createImage(src1.width,src1.height,ARGB);
- PImage _src2 = createImage(src2.width,src2.height,ARGB);
- arraycopy(src1.pixels,_src1.pixels);
- arraycopy(src2.pixels,_src2.pixels);
- _src2.blend(_src1,0,0,_src2.width,_src2.height,0,0,_src2.width,_src2.height,ADD);
- }
Basically I want to write an algorithm to replace line 6 with a function that blends the two without the algorithm using either as the master sum of the r,g,b values. I want the blend to be mutually exclusive.