I use the export command
Export[path_to_png_image,content,ImageSize->{xres,yres},Background->None]
to create PNG images with transparency and some fixed dimension in pixels (1280x960). Strange enough, Finder (I am on macOS) shows me a "resolution" of 144 for the exported images. Indeed, I can add the Option ImageResolution->integer
in the export command and if I do so, Finder afterwards shows me the chosen integer as the "resolution". This makes no sense to me as the images have the same dimension in pixels and have the same file size. In principle, I could just ignore this issue, but unfortunately it matters when I import the pictures into Keynote. If I import a 1280x960 pixel image with a "resolution" of 144 into Keynote, its "Original size" according to Keynote is 640x480.
Edit: So apparently PNG has an optional header with the DPI
https://www.w3.org/TR/2003/REC-PNG-20031110/#11pHYs
which is probably controlled with ImageResolution->integer setting. But what does Mathematica exactly do when I crank up ImageResolution from 72 (what I assume is the standard resolution)? Compute more subpixels and then average over the subpixels to create one pixel?
ImageSize
without setting anImageResolution
and then import it in GIMP, then GIMP reports a 72 dpi resolution (i.e. "screen resolution"). If, on the other hand, I specify anImageResolution
as well, then the same image resolution is reported in GIMP as well. Not sure where the problem is. In any case, please add details on your version etc (for instance, add the output of$Version
to your post). $\endgroup$RasterSize
controls the number of pixels in the resulting image.ImageResolution
controls the size of said pixels. Any app that has to deal with scaling needs to know both values in order to accurately display the image on a device. $\endgroup$