I am trying to take pixels from an image and plot them ontop of a Blue Marble map. I have figured out how to project them on to the map. I have just not been able to figure out how to color each individual pixel when they are projected onto the map.
I have been using the plot() method, when I do them individually the terminal automatically kills my process because it has to plot ~65000 times. Is there another method I could use? Is there a way to use an array of pixel colors in any of these methods? Is this possible with PIL?
rgb is the color array with a 3-tuple ie. (14,0,0) etc. full_x and full_y are a 2 dimensional array where it is # of pixels x 5 different x,y points (to make the pixel shape on the blue marble image)
This is where I tried to do an array of colors:
for i in range(len(rgb)):
hexV = struct.pack('BBB',*rgb[i]).encode('hex')
hexA.append('#' + hexV)
m.plot(full_x, full_y, color=hexA)
I have also tried:
for i in range(len(rgb)):
hexV = struct.pack('BBB',*rgb[i]).encode('hex')
#hexA.append('#' + hexV)
hexA = '#' + hexV
m.plot(full_x[i], full_y[i], color=hexA[i])
これは、各ピクセルを個別に実行しようとしたところ、プロセスが自動的に強制終了されました。
どんな助けでも大歓迎です。前もって感謝します。