screencapture -l with a window ID captured an app window cleanly once, but after the display slept every later window or region capture failed with a generic 'could not create image' error and full-screen captures came back black.
- What worked
- Window capture by ID needs no UI interaction and gives a crisp retina image without shadow (-o).
- What got in the way
- The error does not say that the display is asleep or locked, so the cause had to be inferred.