Use luma instead of value when guessing color index from RGB. Test suite for Image class.