The second loop could probably be removed and the extra storage avoided if this was changed to:
int varRgb = var.getRGB(j,i);
int contRgb = cont.getRGB(j,i);
mins += Math.min((varRgb & 0x00FF0000) >> 16, (contRgb & 0x00FF0000) >> 16);
maxs += Math.max((varRgb & 0x00FF0000) >> 16, (contRgb & 0x00FF0000) >> 16);
mins += Math.min((varRgb & 0x00FF0000) >> 8, (contRgb & 0x0000FF00) >> 8);
maxs += Math.max((varRgb & 0x00FF0000) >> 8, (contRgb & 0x0000FF00) >> 8);
mins += Math.min(varRgb & 0x00FF0000, contRgb & 0x000000FF);
maxs += Math.max(varRgb & 0x00FF0000, contRgb & 0x000000FF);