Here is a problem. I want to visualize a specific vector field as a bitmap. It’s ok with the representation itself, so I allready have some matrix of RGB lists like [255,255,115], but I have no good idea of how to draw it on screen. So far I make thousands of colored 1px rectangles, but this works too slow. I’m sure there is a better way to draw a bitmap.
Share
ATTEMPT 3 – I swear last one…
I believe this is the fastest pure TK way to do this. Generates 10,000 RGB values in a list of lists, creates a Tkinter.PhotoImage and then puts the pixel values into it.
ATTEMPT 1 – using the create_rectangle method
I wrote this as a test. On my Intel Core 2 duo at 2.67 Ghz, it’ll draw about 5000 pixels in 0.6 seconds including the time to generate my random RGB values:
ATTEMPT 2 – Using PIL
I know you said TK only but PIL makes this really easy and fast.