Faster gray to value_type conversion.