There is a game called Roblox, in which the player makes the game, usually of lego-looking bricks.
In Roblox, for the Brick colors, you can use typical RGB values, but that'd require an additional element that is not very efficient when it comes to file size. Instead of using RGB values, BrickColor is much more economic in file size. It uses an integer to be interpreted as a certain color. Here is what I mean:
Here is a snippet of my code:
import Image
f = raw_input('Image:\n')
im = Image.open(f)
rgb_im = im.convert('RGB')
r, g, b = rgb_im.getpixel((x, y))
In my program, I need to find the color code closest to an RGB value.
How might this be accomplished?