#Python #numpy #imageProcessing I have done this before but I can’t remember how and I’m lazy:
Say you have a table/dict of ints to colors like this palette = {
1: rgb(100, 0, 200),
2: rgb(200, 100, 0),
3: rgb(0, 200, 100),
…}
And I have another 2D array of ints that I want to convert to a stack of RGB arrays so as to make an image of them (with #Pillow, or in my case #py5)
Which would be an elegant way of doing it?
(Writing this I had an idea, but I have to get out to my weekend shift at Sesc… maybe I’ll try it later)
cc @TomLarrow@TomLarrow