[macOS Sonoma] screencapture CLI no longer includes DPI information

Using the screencapture CLI on macOS Sonoma 14.0 (23A344) results in a 72dpi image file, no matter if it was captured on a retina display or not.

For example, using screencapture -i ~/Desktop/test.png in Terminal lets me create a selective screenshot, but the resulting file does not contain any DPI metadata (checked using mdls ~/Desktop/test.png), nor does the image itself have the correct DPI information (should be 144, but it's always 72; checked using Preview.app).

I noticed a (new?) flag option, -r, for which the documentation states:

-r Do not add screen dpi meta data to captured file.

Is that flag somehow automatically set? Setting it myself makes no difference and obviously results in a no-dpi-in-metadata and wrong-dpi-in-image file.

The only two ways I got the correct DPI information in a resulting image file was using the default options (forced by -p): screencapture -i -p, and by making the capture go to the clipboard screencapture -i -c. Sadly, I can't use those in my case.

  • Feedback filed: FB13208235

I'd appreciate any pointers, Matthias

I'm having the same issue on Sonoma. Looking forward to see a fix for this :(

For video recordings (screencapture -v -R 0,0,400,400 ~/Desktop/test.mov), the pixelDensity metadata tag appears to be correctly written to the file, though on the other hand, -r (see explanation above) doesn't seem to have an effect here, either (the pixelDensity metadata is still written to the movie file nonetheless).

Issue still exists in macOS Sonoma 14.1 (23B74)

Issue still exists under macOS Sonoma 14.4b23E5196e (Feedback ID: FB13208235)

[macOS Sonoma] screencapture CLI no longer includes DPI information
 
 
Q