bugfix #3121: corrected calculation of blue channel index