How can I save a Makie heatmap as PNG with one pixel per matrix element?

You can do this by directly drawing to a scene with the pixel camera projection:

x = rand(300, 400)
scene = Scene(camera=campixel!, resolution=size(x))
heatmap!(scene, x)
save("out.png", scene)
4 Likes