Can I use GR / Plots to create a pixel-perfect image?

Is there a way to guarantee that no sampling occurs in GR, and i.e. my (3000, 4000) array is rasterized without any sampling? I want each pixel to correspond to an array element in my PNG. From reading the GR docs about resampling, it seems like it must store an internal raster representation. Naively I would specify size in Plots.jl to be the size of my array, but would this include things like ticks and labels?

Just to clarify, you have a plot that is ready (which is not simply an image plotted with heatmap) and you would like to save this plot with a specific resolution? Have you looked at savefig already? Maybe it has options to control the resolution and options to send the plot to an IOBuffer instead of a file on disk.

Sorry I wasn’t clear! I indeed have an image plotted with a heatmap, and I’m trying to avoid things like aliasing by having that image be unmodified by scaling, when I get the PNG of this heatmap.

ImageView.jl ?

That’s fair – I’m willing to just use the JuliaImages machinery if my requirement is specifically to generate images! Thank you.