Thanks Sebastian,
ppm module is indeed very useful. So, I guess my question then just boils down to, how can I write a function to mimic the setPixel function ->
Basically, a blank white image would look like this (as per ppm module)
[
[ (255, 255, 255) , (255, 255, 255) , (255, 255, 255) ] , -- 3 columns of row 1
[ (255, 255, 255) , (255, 255, 255) , (255, 255, 255) ] --- 3 columns of row 2
]
setPixel x y r g b when called like this - setPixel 0,0,255,0,0
[
[ (255, 0, 0) , (255, 255, 255) , (255, 255, 255) ] , -- 3 columns of row 1
[ (255, 255, 255) , (255, 255, 255) , (255, 255, 255) ] --- 3 columns of row 2
]
What would be a good way to implement such a function?