Takes all the colors from a .blend file and creates a texture to be used as a UV map.
Gamma correction:
https://stackoverflow.com/questions/17910543/convert-gamma-rgb-curves-to-rgb-curves-with-no-gamma/17910665#17910665
Useful UV stuff:
https://blender.stackexchange.com/questions/70676/python-selecting-faces-from-a-material-index
Pixel art in blender:
http://blendersushi.blogspot.ro/2013/03/python-pixel-art-in-blender.html