Skip to content

Screenshots

NuclearMeltdown edited this page Aug 24, 2026 · 2 revisions

Screenshots

src/record/screenshot.cpp, src/render/video_renderer.cpp (GrabStill, GrabStillHalf)

F10 by default. Written at source resolution, after crop, deinterlacing and rotation, and before the interface is drawn — so no toolbar, no statistics overlay, no toast in the picture.

SDR: PNG and JPEG

Through Windows Imaging Component, which ships with Windows. A screenshot is the one output that should work on a fresh machine where nobody has pressed the ffmpeg download button yet.

GrabStill() copies the current picture out once, tightly packed, in VideoRenderer::kReadbackPixelFormat. Unlike the recording path this waits for the GPU, which costs a millisecond or two — acceptable for a key press, not for every frame. Alpha comes back opaque. It must be called on the render thread.

HDR: JPEG XR and AVIF

Only offered when the source is actually HDR and the "keep the range" switch for screenshots is on. See High dynamic range.

GrabStillHalf() returns the picture as linear light, four half floats per pixel, 1.0 meaning diffuse white.

JPEG XR (.jxr)

SaveScreenshotHdr(). Holds scRGB half floats, which is exactly what Windows itself writes for an HDR screenshot — and therefore what the Photos app opens as one rather than as a dark mess.

Costs nothing: Windows ships the encoder, so screenshots stay the one part of CapView that never needs ffmpeg.

paperWhiteNits is passed in because scRGB fixes its own 1.0 at eighty nits, so the linear values have to be scaled into that convention.

AVIF

SaveScreenshotAvif(). Ten bit PQ in BT.2020, with the colour description that makes it an HDR image rather than a dark one.

Read by every browser and by most things that are not Windows — but it goes through ffmpeg. Since ffmpeg is already there for recording that is not a new dependency, only a newly required one, and the format picker says so.

Why not 16-bit PNG

Nothing would know to read it as HDR. PNG has no place to say "this is on the PQ curve" that any viewer acts on, so a 16-bit PNG of HDR content is a file full of correct numbers that every program displays wrongly.

File naming

MakeScreenshotPath() builds a timestamped name in the configured folder, with a counter appended when the same second is hit twice. It creates the folder if necessary and returns empty when it cannot.

MakeHdrScreenshotPath() is the same for the two HDR formats.

The default folder is Pictures\CapView (DefaultScreenshotFolder()).

Clone this wiki locally