int mg = leftColor.calculateGreen(lPixel.r, lPixel.g, lPixel.b) + rightColor.calculateGreen(rPixel.r, rPixel.g, rPixel.b);
if (mg < 0)
mg = 0;
else if (mg > 255)
mg = 255;
int mb = leftColor.calculateBlue(lPixel.r, lPixel.g, lPixel.b) + rightColor.calculateBlue(rPixel.r, rPixel.g, rPixel.b);
if (mb < 0)
mb = 0;
else if (mb > 255)
mb = 255;
mergedImg.setRGB(j, i, mr, mg, mb);