Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a single still image on macOS, use SCScreenshotManager.captureImage(contentFilter:configuration:). It returns one CGImage asynchronously. First request shareable content, select a display or window, create an SCContentFilter, configure the capture with SCStreamConfiguration, and handle the throwing call with try await. Use an SCStream instead only when you need a continuing sequence of frames.

Choose the ScreenCaptureKit API for the job

ScreenCaptureKit has several capture paths that look similar but produce different results:

Need API and result Configuration
One frame as an image SCScreenshotManager.captureImage(contentFilter:configuration:) returns one CGImage asynchronously and can throw. SCStreamConfiguration
One frame as a sample buffer captureSampleBuffer returns one CMSampleBuffer. Use the configuration required by that API.
Screenshot-oriented output controls captureScreenshot supports screenshot-specific rendering and output choices. SCScreenshotConfiguration
Continuous recording or live processing An SCStream delivers ongoing sample buffers during a capture session. Stream configuration plus stream output handling.

This guide focuses on a one-off CGImage. Do not pass SCScreenshotConfiguration to captureImage; the two APIs use different configuration types.

Prerequisites and permission

Set the usage description

In your Xcode target, open the Info settings and add the NSScreenCaptureUsageDescription entry. Explain why the app needs to capture screen content. ScreenCaptureKit’s documentation instructs apps to request screen-recording permission before capturing content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Apple 2026 MacBook Neo 13-inch Laptop with A18 Pro chip: Built for AI and Apple Intelligence, Liquid Retina Display, 8GB Unified Memory, 256GB SSD Storage, 1080p FaceTime HD Camera; Blush
  • AN AMAZING MAC AT A SURPRISING PRICE — With an incredibly portable and durable aluminum design, up to 16 hours of battery life,* and the A18 Pro chip, MacBook Neo is ready to go wherever school takes you.
  • FOUR STUNNING COLORS. ONE DURABLE DESIGN — Choose from four beautiful colors — Silver, Blush, Citrus, or Indigo — each with a color-coordinated keyboard. And MacBook Neo is made with a durable recycled aluminum enclosure that helps it reach 60 percent recycled content by weight — the most ever in any Apple product.*
  • FLY THROUGH EVERYDAY ASSIGNMENTS — Whether you’re cramming for finals, using Apple Intelligence* to summarize class notes, creating presentations, or even playing the latest Apple Arcade game,* MacBook Neo delivers the performance and AI capabilities you need to get things done.
  • UP TO 16 HOURS OF BATTERY LIFE — MacBook Neo delivers all day battery life, so you can power through from early morning classes to late night study sessions without worrying about plugging in.
  • A VIBRANT 13-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Neo supports 1 billion colors, so photos and videos pop and text is crisp for easy reading.

Grant Screen Recording access

On first use, macOS may show the Screen Recording privacy prompt. Apple’s “Capturing screen content in macOS” sample documents a flow in which you grant access in System Settings and restart the sample app before attempting another capture. Treat that restart as sample behavior rather than a guarantee for every project; still, a restart is a useful first recovery step when permission was just changed.

The sample project lists macOS 15 or later and Xcode 16 or later. Those are the sample’s requirements, not a complete availability matrix for every ScreenCaptureKit symbol. Check the SDK availability of the APIs you call and set your deployment target accordingly.

Minimal one-frame capture in Swift

The following macOS example queries shareable content, chooses the first display, creates a filter, captures one image, and writes a PNG. It keeps the asynchronous work in a Task and reports errors instead of assuming capture succeeds.

import AppKit
import ScreenCaptureKit
import ImageIO
import UniformTypeIdentifiers

@main
struct OneFrameCapture {
    static func main() async {
        do {
            let content = try await SCShareableContent.excludingDesktopWindows(
                false,
                onScreenWindowsOnly: true
            )

            guard let display = content.displays.first else {
                throw CaptureError.noDisplay
            }

            let filter = SCContentFilter(display: display, excludingWindows: [])
            let configuration = SCStreamConfiguration()
            configuration.width = display.width
            configuration.height = display.height
            configuration.showsCursor = false

            let image = try await SCScreenshotManager.captureImage(
                contentFilter: filter,
                configuration: configuration
            )

            try savePNG(image, to: URL(fileURLWithPath: "/tmp/screen.png"))
            print("Saved /tmp/screen.png")
        } catch {
            fputs("Screenshot failed: (error)n", stderr)
            exit(EXIT_FAILURE)
        }
    }

    static func savePNG(_ image: CGImage, to url: URL) throws {
        guard let destination = CGImageDestinationCreateWithURL(
            url as CFURL,
            UTType.png.identifier as CFString,
            1,
            nil
        ) else {
            throw CaptureError.cannotCreateDestination
        }

        CGImageDestinationAddImage(destination, image, nil)
        guard CGImageDestinationFinalize(destination) else {
            throw CaptureError.cannotWriteImage
        }
    }

    enum CaptureError: Error {
        case noDisplay
        case cannotCreateDestination
        case cannotWriteImage
    }
}

captureImage returns a CGImage; the Image I/O code is only for persistence. You can instead draw the image into an AppKit view, pass it to Core Image, or encode it with another image pipeline.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Apple 2026 MacBook Air 13-inch Laptop with M5 chip: Built for AI, 13.6-inch Liquid Retina Display, 16GB Unified Memory, 512GB SSD, 12MP Center Stage Camera, Touch ID, Wi-Fi 7; Midnight
  • BUILT FOR COLLEGE. AND BEYOND — MacBook Air with the M5 chip packs blazing speed and powerful AI capabilities into an incredibly portable design. And with up to 18 hours of battery life,* this thin and light powerhouse is ready to take on almost any major, just about anywhere.
  • TEAR THROUGH TOUGH ASSIGNMENTS — With its faster CPU and unified memory, the M5 chip delivers even more performance and fluidity across apps, making multitasking and creative workflows smooth and responsive. A powerful Neural Engine and next-generation GPU with Neural Accelerators give you a powerful platform for AI.
  • MAKE QUICK WORK OF YOUR TO-DO LIST — Apple Intelligence helps you write, express yourself, and get things done effortlessly — whether it’s for school or everyday life. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • UP TO 18 HOURS OF BATTERY LIFE — MacBook Air delivers incredible battery life with amazing performance, so you can power through a full day of classes without worrying about plugging in.
  • A BRILLIANT 13.6-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Air supports 1 billion colors, making photos and videos pop with rich contrast and sharp detail, and text appears supercrisp. So everything — from class presentations to movies to games — looks truly stunning.

Select a display or a window deliberately

Capture a display

SCShareableContent exposes available displays, running applications, and windows. The display initializer used above scopes the filter to one display. Set the configuration dimensions to the pixel dimensions you want, rather than assuming a point-to-pixel relationship on a Retina Mac.

Capture one window

Find the desired SCWindow in content.windows, then create a window filter:

guard let window = content.windows.first(where: { $0.title == "My App" }) else {
    throw CaptureError.noWindow
}

let filter = SCContentFilter(desktopIndependentWindow: window)
let configuration = SCStreamConfiguration()
configuration.width = window.frame.width
configuration.height = window.frame.height
let image = try await SCScreenshotManager.captureImage(
    contentFilter: filter,
    configuration: configuration
)

Titles are not stable identifiers. For production code, inspect the available windows and choose using the owner application, window ID, title, or another rule appropriate to your UI. Handle the case where a window closes between the content query and the capture.

Exclude windows from a display capture

The display filter can be constructed with an exclusion list. This is useful when your own overlay or control window should not appear in the result. Build the list from the SCWindow instances returned by the same shareable-content query.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Apple 2026 MacBook Neo 13-inch Laptop with A18 Pro chip: Built for AI and Apple Intelligence, Liquid Retina Display, 8GB Unified Memory, 256GB SSD Storage, 1080p FaceTime HD Camera; Indigo
  • AN AMAZING MAC AT A SURPRISING PRICE — With an incredibly portable and durable aluminum design, up to 16 hours of battery life,* and the A18 Pro chip, MacBook Neo is ready to go wherever school takes you.
  • FOUR STUNNING COLORS. ONE DURABLE DESIGN — Choose from four beautiful colors — Silver, Blush, Citrus, or Indigo — each with a color-coordinated keyboard. And MacBook Neo is made with a durable recycled aluminum enclosure that helps it reach 60 percent recycled content by weight — the most ever in any Apple product.*
  • FLY THROUGH EVERYDAY ASSIGNMENTS — Whether you’re cramming for finals, using Apple Intelligence* to summarize class notes, creating presentations, or even playing the latest Apple Arcade game,* MacBook Neo delivers the performance and AI capabilities you need to get things done.
  • UP TO 16 HOURS OF BATTERY LIFE — MacBook Neo delivers all day battery life, so you can power through from early morning classes to late night study sessions without worrying about plugging in.
  • A VIBRANT 13-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Neo supports 1 billion colors, so photos and videos pop and text is crisp for easy reading.

Configure dimensions and cursor behavior

SCStreamConfiguration is the configuration accepted by captureImage. Set only the properties your capture needs, and keep the source filter and output dimensions consistent.

  • Width and height: request the pixel dimensions required by your output. A larger image uses more memory and takes longer to encode.
  • Cursor: set showsCursor according to whether the pointer belongs in the image.
  • Scaling: account for Retina displays when selecting dimensions; a window’s logical frame and the rendered pixel size are not necessarily identical.
  • Timing: if the app must capture after a UI update, schedule the call after that update and keep the resulting image associated with the state that produced it.

For a screenshot with cropping, format selection, dynamic range, display intent, cursor visibility, window-shadow handling, or explicit source and destination rectangles, use the separate captureScreenshot path with SCScreenshotConfiguration.

Using SCScreenshotConfiguration for screenshot output

SCScreenshotConfiguration is associated with captureScreenshot, not captureImage. Its documented controls include:

  • Output content type: HEIC, JPEG, or PNG.
  • Pixel width and height.
  • Standard or high dynamic range.
  • Display intent.
  • Source and destination rectangles for cropping and placement.
  • Cursor visibility.
  • Window shadow and clipping behavior.

Choose this API when those screenshot-specific decisions should be made by the capture configuration. Choose captureImage when a single CGImage is the most convenient hand-off to the rest of your Swift code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Apple 2026 MacBook Neo 13-inch Laptop with A18 Pro chip: Built for AI and Apple Intelligence, Liquid Retina Display, 8GB Unified Memory, 256GB SSD Storage, 1080p FaceTime HD Camera; Citrus
  • AN AMAZING MAC AT A SURPRISING PRICE — With an incredibly portable and durable aluminum design, up to 16 hours of battery life,* and the A18 Pro chip, MacBook Neo is ready to go wherever school takes you.
  • FOUR STUNNING COLORS. ONE DURABLE DESIGN — Choose from four beautiful colors — Silver, Blush, Citrus, or Indigo — each with a color-coordinated keyboard. And MacBook Neo is made with a durable recycled aluminum enclosure that helps it reach 60 percent recycled content by weight — the most ever in any Apple product.*
  • FLY THROUGH EVERYDAY ASSIGNMENTS — Whether you’re cramming for finals, using Apple Intelligence* to summarize class notes, creating presentations, or even playing the latest Apple Arcade game,* MacBook Neo delivers the performance and AI capabilities you need to get things done.
  • UP TO 16 HOURS OF BATTERY LIFE — MacBook Neo delivers all day battery life, so you can power through from early morning classes to late night study sessions without worrying about plugging in.
  • A VIBRANT 13-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Neo supports 1 billion colors, so photos and videos pop and text is crisp for easy reading.

Error handling and troubleshooting

Permission errors or a blank result

  • Confirm NSScreenCaptureUsageDescription exists in the target’s Info settings.
  • Open System Settings, Privacy & Security, then Screen Recording, and enable the app or executable that is actually running.
  • Quit and relaunch after changing permission; the Apple sample specifically documents a restart after the initial grant.
  • Make sure the capture call is reached after the permission flow, not during app initialization before the user can respond.

No displays or windows are returned

Check the result of SCShareableContent and fail with a useful message when the selected array is empty. A window can disappear between enumeration and capture, so query again or surface a retry action.

The wrong content is captured

Inspect the filter construction. A display filter captures the selected display; a window filter captures the selected window. Exclusion lists can remove content you expected to see. Log the chosen display, window title, and owner during development.

The image size is unexpected

Verify SCStreamConfiguration.width and height, and distinguish logical window coordinates from output pixels on Retina hardware. For strict crop and placement control, move to SCScreenshotConfiguration and its source and destination rectangles.

The call throws intermittently

Keep the do/catch, preserve the underlying error for diagnostics, and retry only after checking that permission, the filter’s source, and the target window are still valid. Do not turn every failure into a blank image; a failed capture should remain an explicit failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Apple 2026 MacBook Pro Laptop with Apple M5 Pro chip with 18-core CPU and 20-core GPU: Built for AI, 16.2-inch Liquid Retina XDR Display, 24GB Unified Memory, 1TB SSD, Wi-Fi 7; Space Black
  • FAST RUNS IN THE FAMILY — The 16-inch MacBook Pro with the M5 Pro or M5 Max chip brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. With all-day battery life, double the starting storage,* and a breathtaking Liquid Retina XDR display, it’s pro in every way.*
  • BUCKLE UP — Along with a next-generation CPU, faster unified memory, and up to 2x faster SSD storage,* M5 Pro and M5 Max feature a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance and on-device training capabilities. So you can blaze through demanding workloads at mind-bending speeds.
  • BUILT FOR AI — Apple silicon, and every major component that powers it, is designed to run demanding on-device AI workloads like LLM inference and training. And Apple Intelligence helps you write, express yourself, and get things done effortlessly with groundbreaking privacy protections at every step.*
  • ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.*
  • MACOS RUNS APPS FAST — All your go-to apps run lightning fast in macOS, including built-in apps like FaceTime and Messages. Plus, built-in virus protection and free software updates help keep your Mac running smoothly and securely.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and lifecycle choices

  • One frame: use captureImage; it avoids maintaining a stream when no ongoing frames are needed.
  • Repeated frames: use SCStream and process sample buffers, rather than repeatedly starting unrelated still captures.
  • Memory: high-resolution displays produce large CGImage objects. Encode or downsample promptly when retaining many images.
  • Concurrency: keep capture off the main actor when possible, then deliver the finished image to UI code on the main actor.
  • Content changes: query shareable content again when users switch windows, displays, or permissions; do not assume an old filter remains valid forever.

Checklist before shipping

  • The app includes NSScreenCaptureUsageDescription with a clear explanation.
  • Screen Recording permission is requested and failures are presented clearly.
  • The code queries SCShareableContent and deliberately selects a display or window.
  • The filter matches the intended source and exclusions.
  • captureImage receives SCStreamConfiguration; screenshot-specific controls use captureScreenshot with SCScreenshotConfiguration.
  • The requested dimensions, cursor setting, dynamic-range needs, and output format match the product requirement.
  • The deployment target and SDK availability have been checked for every API used.
  • Encoding errors and disappearing windows are handled rather than silently ignored.

Or skip the browser setup

If your goal is a URL screenshot rather than pixels from the Mac’s own display, ScreenshotNeo provides a single HTTP request. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo documentation for request options. It also offers an MCP server with take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. Every plan includes its features; 1,000 screenshots per month are free with no card, and paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account.

Frequently Asked Questions

Can ScreenCaptureKit capture a website URL directly?

No. ScreenCaptureKit captures content available on the Mac, such as a display or window. For server-side URL rendering, use a browser-based screenshot service such as ScreenshotNeo.

Should I use an SCStream for a single screenshot?

Usually no. Use the single-frame capture API unless you need ongoing frames, audio, or stream-level processing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does my code compile with the wrong configuration type?

captureImage uses SCStreamConfiguration, while captureScreenshot uses SCScreenshotConfiguration. They are separate API paths.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.