improved ImagePainter: color indices for values >= 1, grayscale otherwise