Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallUse Phaser’s renderer snapshot API when you need the pixels drawn in the game canvas. Call snapshot() after the current frame renders for the entire viewport, or snapshotArea() for a rectangle. The callback receives an image that you can display or pass to your own download flow.
“Game div” can mean the Phaser canvas, its parent element, or HTML controls layered over the canvas. Phaser’s renderer snapshot captures the canvas frame—not a guaranteed screenshot of surrounding DOM. If menus, score panels, or other Phaser DOM Elements must appear, use a browser-level element or page capture instead.
Choose the capture target first
| What you need | Use | What is included |
|---|---|---|
| Entire rendered game | renderer.snapshot() |
Pixels in the Phaser canvas viewport |
| A rectangle in the game | renderer.snapshotArea(x, y, width, height, callback) |
Canvas pixels in viewport coordinates |
| One pixel’s color | renderer.snapshotPixel(x, y, callback) |
A color value, not an image |
| Canvas plus HTML overlays or page content | Browser/page-level capture | The DOM region, subject to browser capture behavior |
Phaser DOM Elements are ordinary HTML positioned in a DOM container over the canvas. They are not part of the canvas bitmap, so a renderer snapshot should not be described as a screenshot of the complete parent div.
Check your Phaser version before copying code
The current renderer documentation identified for this guide is Phaser v4.1.0, and a separate official Phaser 3.90.0 reference exists. Snapshot signatures and the way you reach the renderer can differ between major versions. Check the version installed by your project and its renderer API before using an example.
The methods discussed here are the versioned renderer methods snapshot(callback, [type], [encoderOptions]) and snapshotArea(x, y, width, height, callback, [type], [encoderOptions]). The examples below use the conceptual access path game.renderer; use the actual Game or renderer instance exposed by your version.
Capture the full Phaser game canvas
// Run after the Phaser Game has booted and rendered at least one frame.
game.renderer.snapshot((image) => {
if (!image) {
console.error('Phaser did not return a snapshot image');
return;
}
// image is the returned HTMLImageElement.
document.body.appendChild(image);
}, 'image/png');
The first argument is the callback. Phaser supplies the resulting image there. image/png is the documented default; use image/jpeg when a lossy image is appropriate. JPEG quality belongs in the encoder-options argument for versions that expose it.
Do not request the snapshot before the game has rendered. A boot-time call can capture an empty or incomplete frame. Trigger it from a button, a scene event after the first render, or another point where the desired frame is visible.
Save the returned image in your application
The renderer documentation guarantees the callback image, but a universal download workflow depends on your browser and Phaser version. A common browser-side pattern is to draw the returned image to a temporary canvas, convert that canvas to a data URL, and click a temporary link:
Recommended Free Tools
function downloadSnapshot(game) {
game.renderer.snapshot((image) => {
if (!image) {
console.error('Snapshot failed');
return;
}
const canvas = document.createElement('canvas');
canvas.width = image.naturalWidth || image.width;
canvas.height = image.naturalHeight || image.height;
const context = canvas.getContext('2d');
context.drawImage(image, 0, 0);
const link = document.createElement('a');
link.download = 'phaser-game.png';
link.href = canvas.toDataURL('image/png');
link.click();
}, 'image/png');
}
This is an implementation pattern, not a promise that every cross-origin asset configuration will permit export. If the game draws images from another origin without suitable CORS permission, the browser can taint the canvas and refuse pixel export. Configure image hosting and response headers for your own assets, or use a page-level capture service that can access the page as a browser.
Rank #2
Capture only part of the canvas
snapshotArea uses coordinates in the game viewport. They are not world coordinates, camera coordinates, or CSS coordinates outside the canvas. For a 400-by-300 rectangle starting at viewport position (100, 50):
game.renderer.snapshotArea(
100, 50, 400, 300,
(image) => {
if (!image) return;
document.querySelector('#preview').replaceChildren(image);
},
'image/png'
);
Convert world positions to viewport positions yourself before calling this method. Also account for the game’s scaling mode: the renderer captures the internal canvas viewport, while a CSS-scaled canvas may occupy a different size on screen.
Image type, quality, and timing
- PNG is the default and preserves lossless pixels, making it suitable for UI, text, and pixel art.
- JPEG can reduce file size for photographic or gradient-heavy scenes. Its quality setting applies to lossy formats and is supplied through the encoder-options parameter supported by your Phaser version.
- Only one snapshot can be active per frame. A later request can replace a snapshot already scheduled for that frame, so do not fire competing requests from several listeners.
- Snapshots are blocking image operations. Phaser documents that larger canvases cost more, and WebGL capture reads frame-buffer pixels into a temporary canvas before creating the callback image.
For repeated captures, throttle requests to an intentional interval, avoid capturing every render tick, and consider a smaller capture area or a lower output size. For a single user-initiated screenshot, the blocking cost is usually easier to tolerate.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesCanvas-only versus a complete “game div” screenshot
Canvas-only output
Use snapshot() when all visible content is drawn by Phaser’s Canvas or WebGL renderer. It is deterministic with respect to the rendered frame and does not depend on the surrounding page layout.
HTML overlays
Phaser’s DOM Element feature places standard HTML and CSS in a DOM container sized to match the canvas. HTML buttons, forms, inventory panels, and score labels in that layer will not be painted into the renderer snapshot. To include them, capture the DOM element or page with a browser automation tool, and verify the result in the browser and layout you support.
Parent containers and page chrome
A parent div may include margins, backgrounds, advertisements, or controls outside the canvas. Those are page pixels, not Phaser renderer pixels. A browser-level capture is the correct approach when the requirement is “exactly what the user sees,” rather than “the game frame.”
Troubleshooting
The callback receives no image
Handle a missing callback argument. Phaser documents this possibility for failed image creation in the static Canvas snapshot path. Check that the game has rendered, that the renderer instance is valid, and that the requested frame is not being destroyed during a scene transition.
The screenshot is blank or from the wrong moment
Schedule the call after the desired state is rendered. A button handler, a post-update event, or a short application-level wait is safer than calling during game construction. Ensure that another snapshot request is not replacing yours in the same frame.
HTML controls are missing
That is expected for DOM Elements. Capture the relevant DOM node or page instead of the renderer canvas. If you need a composited image, render the overlay into the canvas yourself before taking the snapshot, or use browser capture.
The rectangle is misplaced
snapshotArea expects viewport coordinates. Do not pass world coordinates or the parent element’s page coordinates. Confirm the internal game size, camera transform, and scaling configuration.
Rank #4
Export fails after drawing external images
Cross-origin images can taint a canvas. Serve assets with appropriate CORS headers and load them with the required cross-origin mode, or avoid client-side pixel export and use a browser capture path.
Captures stall the game
Large canvases make snapshots more expensive. Capture less often, reduce the area, pause nonessential work around a user-requested capture, and avoid running the operation in the render loop.
When a browser-level capture is the better engineering choice
Choose page capture when the acceptance criteria include DOM overlays, responsive CSS, browser chrome inside a test fixture, or the exact composition of a hosted game page. It also avoids requiring your game code to expose a renderer instance. Validate authentication, consent dialogs, bot checks, cross-origin resources, lazy-loaded assets, and animations in the target environment before relying on automated output.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
ScreenshotNeo provides a website screenshot API when you need the whole hosted page rather than only Phaser’s canvas bitmap. Before capture it accepts the cookie or consent banner and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result. It also offers an MCP server for AI agents with take_screenshot, get_page_info, and capture_pdf.
See the ScreenshotNeo API documentation for all options. A one-call PNG, JPEG, or WebP request can target the page hosting your Phaser game:
Free tools Windows power users keep installed
One-click scans. No signup required.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/game -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/game"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/game' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo includes full-page capture with lazy images, CSS-selector element capture, device and viewport controls, retina scale, custom CSS and JavaScript, click and wait actions, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed links, asynchronous webhooks, bulk capture for up to 100 URLs per call, usage data, and an OpenAPI specification. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
Best Value
Frequently Asked Questions
Can Phaser capture a screenshot before the first scene appears?
Wait until the game has booted and rendered the frame you want. An early call can produce an empty or incomplete image.
Does snapshotArea crop by world coordinates?
No. Its x, y, width, and height describe a rectangle in the rendered game viewport.
Which method captures a single pixel instead of an image?
Use snapshotPixel(x, y, callback). It returns a pixel color, not a screenshot.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Can I use the renderer snapshot for a PDF?
The renderer methods produce an image callback. Use a page-level PDF capture workflow when the output must include DOM overlays or document layout.
Quick Recap
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.




