I have a 500x500 array of Int64s between 1 and 10, representing arbitrary categories. I can display this as an image by doing the following in a notebook:
using Colors
colors = distinguishable_colors(10)
and then
[colors[d] for d in my_data]
but the problem is it takes quite a few seconds before the image is displayed, which makes me think I’m doing it the wrong way.
Is there a faster way to achieve the same effect? I was hoping to be able to animate the image as my data updates.
On my laptop, I just times an ímshow (from ImageView) of a 500x500 random array
julia> @time imshow(mydata)
15.419194 seconds (22.85 M allocations: 1.125 GiB, 5.20% gc time)
BUT do that again
julia> @time imshow(mydata)
0.139453 seconds (14.20 k allocations: 850.146 KiB)
Try this with your own data - the second and subsequent calls should be much faster.
I should have mentioned - I’m not able to install ImageView because of this problem. (I basically can’t install anything that relies certain dependencies, which seems to rule out most of the best options.)
The method I posted unfortunately doesn’t run faster the second time.