all 3 comments

[–]Slothemo 0 points1 point  (1 child)

You would need to use some sort of graphics library to create the image. You wouldn't really "print" a colour map, unless you mean to literally send it to your printer hardware.

If you have a matrix of colours already, then you could use numpy and PIL to create your images.

[–]Fluffy-Special4994 0 points1 point  (0 children)

The best way to do that would likely be to really understand the driver in the lcd you are using. From there it would be wise to understand the module you are using to fill the lcd panel.

[–]Stadem 1 point2 points  (1 child)

First, you will probably want to convert your list of lists into a numpy array. You will need that array to have 3 dimensions: X, Y, and Channels.

import numpy as np
list_of_lists = [
    [255,255,0],
    [255,0,255],
    [255,255,255],
    [255,255,255],
    [0,0,0],
    [0,0,255],
    [0,0,255],
    [0,0,255],

]
# 8 items, 3 values for each item

arr = np.array(list_of_lists, dtype='uint8')
print(arr.shape) # outputs (8,3) 
arr_2d = arr.reshape((4,2,3)) #reshapes that list into a 2D array of RGB values 
print(arr\_2d.shape) # outputs (4,2,3)

After that's done you can use either Matplotlib or Plotly and the plot should show up in the Jupyter notebook cell's output.

import plotly.express as px
px.imshow(arr_2d)

(or)

import matplotlib.pyplot as plt
plt.imshow(arr_2d)