function mg_make_background_random, xsize, ysize
compile_opt strictarr
z = randomu(seed, xsize, ysize)
kernel_sizes = [5, 5, 5, 5]
for i = 0, n_elements(kernel_sizes) - 1 do begin
z = smooth(temporary(z), kernel_sizes[i], /edge_truncate)
endfor
z = z + sobel(z)
z = z + sobel(z)
return, z
end
pro mg_make_background
compile_opt strictarr
xsize = 1440
ysize = 900
z0 = mg_make_background_random(xsize, ysize)
z1 = sobel(z0)
z2 = smooth(z1, 5, /edge_truncate)
im = bytarr(3, xsize, ysize)
im[0, *, *] = bytscl(z0, top=63B) + 128B + 8B + 4B + 2B
im[1, *, *] = bytscl(z0, top=63B) + 64B + 16B + 8B + 4B
im[2, *, *] = bytscl(z0, top=15B) + 128B + 64B + 32B + 16B
window, /free, xsize=xsize, ysize=ysize, title='Background'
tv, im, true=1
write_png, 'violet_circles.png', im
end