I have spent a week on this issue and need help. My application is to generate a file of images that I later massage and make into a movie. All works great EXCEPT the memory usage limits my number of frames before it crashes. The guilty command is on line 29 of my simple test program: “image!(ax, img)”.
My Code:
using GLMakie, Images, Random
const PROG_NAME = “simple_img_2.jl”
println(“Starting $PROG_NAME”)
cSize = 1200; rSize = 1000
rand_array = rand(Float64, (cSize, rSize))
function make_image(cSize, rSize)
points = Array{HSV{Float64},2}(undef, rSize, cSize)
for c = 1:cSize, r = 1:rSize
m = rand_array[c, r]
hue = (m * 360.0) % 360.0
saturation = 225.0 / 255.0
value = m < 1 ? 1.0 : 0.0
global points[r, c] = HSV(hue, saturation, value)
end
img = n0f8.(RGB.(points))
return img
end # make_image
f = Figure(resolution = (cSize, rSize), figure_padding = 1, backgroundcolor = :gray80)
ax = GLMakie.Axis(f[1, 1], aspect = DataAspect(), yreversed = true, title = “Simple Test 6’”)
println(“starting loop”); sleep(1)
for i in 1:300
if i % 30 == 0; println(“$i”); end
local img = make_image(cSize, rSize)
image!(ax, img’)
# filename = update_sequential_filename(); save(filename, f) # saves as a png
display(f)
end
println(“Leaving $PROG_NAME”)
My indentation got boogered. Better way to submit my code?