I simply painted mine with GIMP, only making sure I was using solid colors all the time (ie. no shades or gradients). DIGITS handled them well for me, but I think it silently converted it somehow. I suspect if you're using only caffe, you'll have to paint your labels in gray mode, using different shades for different labels (that is, pixel values of 0, 1, 2...).