To convert HTML to an image in Go, use Go to control Chromium with chromedp, wait until the page has the content you need, and save a browser screenshot. Go handles orchestration and file I/O; Chromium renders the HTML, CSS, fonts, and JavaScript. This is the broadly applicable option when the page depends on modern browser behavior or dynamic content.
Choose the right rendering and capture approach
Use a browser-backed renderer when you need JavaScript execution, browser-compatible CSS, or a result that reflects how a page renders in Chromium. chromedp is a Go control layer for Chrome DevTools Protocol (CDP); Chromium does the rendering. Its package documentation says chromedp implements the asynchronous CDP client in Go without third-party dependencies. That describes the client, not the browser: you still need a compatible Chrome or Chromium runtime.
As an Amazon Associate I earn from qualifying purchases.
| Approach | Useful when | Important consideration |
|---|---|---|
| chromedp with Chromium | You need browser rendering and control from Go, including JavaScript-driven pages. | Your deployment must provide and manage a compatible browser. The cited documentation does not establish a current version compatibility matrix. |
| go-rod/rod with a browser | You prefer page-oriented browser automation methods for navigation, screenshots, viewport changes, or full-page capture. | It is another browser automation option; the sources do not establish a performance or accuracy advantage over chromedp. |
| go-webengine | Your HTML only needs the CSS and JavaScript subset its project documents. | The project describes its own implementation and capabilities. Verify that your page’s specific CSS and JavaScript work before treating it as a Chromium replacement. |
Before choosing, check that your service can run the browser, decide whether you need the viewport, whole document, or one element, define how the page signals readiness, and choose an image format and destination. No comparative benchmark in the cited material establishes that one option is faster, more stable, or more accurate than another.
Free tools Windows power users keep installed
One-click scans. No signup required.
Capture HTML with Go using chromedp
This self-contained example loads HTML from a data URL, waits for a page-specific readiness marker, captures the visible viewport as PNG, and writes the bytes to a file. It assumes Chrome or Chromium is installed and available to chromedp. Pin chromedp and a compatible browser version in your own project; the cited package docs do not provide a current compatibility matrix.
#1 Best Overall
- AUDIO ALL-ROUNDER – convert your audio or video files into almost any audio format - edit, trim, merge, adjust sample and bit rate, extract audio from videos
- Supported input formats - MP3, MP2, AAC, AC3, WAV, WMA, M4A, RM, RAM, OGG, AU, AIF, AIFF, PG, MPEG, MPEG 2, MP4, M4V, MJPG, MJPEG, HD TS, HD MTS, HD M2TS, HD MPG, HD MPEG, HD MP4, HD WMV, QuickTime HD MOV and others
- Supported output formats - AAC, AC3, AIFF, AMR, AU, FLAC, M4A, MKA, MP2, MP3, OGG, WAV, WMA
- EASY TO INSTALL AND USE - user-friendly and intuitive interface, free tech support whenever you need assistance
- compatible with Windows 10, 8 and 7 (32 and 64-bit versions) - single user license
- Install the Go package: run
go get github.com/chromedp/chromedpin your module. Check the current package documentation for API changes and use a version appropriate for your browser runtime. - Save this as
main.go: the HTML includes a marker that the Go code waits for. Replace the sample markup and selector with your own content and its actual ready state. - Run it: use
go run .. The expected result isshot.pngin the current directory.
package main
import (
"context"
"encoding/base64"
"fmt"
"os"
"time"
"github.com/chromedp/chromedp"
)
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
html := `<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>body { font: 18px sans-serif; padding: 32px; }</style>
</head>
<body>
<h1>A rendered page</h1>
<div id="ready">Content is ready</div>
</body>
</html>`
dataURL := "data:text/html;base64," + base64.StdEncoding.EncodeToString([]byte(html))
var png []byte
err := chromedp.Run(ctx,
chromedp.EmulateViewport(1280, 800),
chromedp.Navigate(dataURL),
chromedp.WaitVisible("#ready", chromedp.ByID),
chromedp.CaptureScreenshot(&png),
)
if err != nil {
fmt.Fprintln(os.Stderr, "capture page:", err)
os.Exit(1)
}
if err := os.WriteFile("shot.png", png, 0600); err != nil {
fmt.Fprintln(os.Stderr, "write screenshot:", err)
os.Exit(1)
}
}
chromedp.CaptureScreenshot captures the visible browser area. For a local HTML file, navigate to its absolute file:// URL instead of the data URL. For a page served by your app, navigate to its HTTP(S) URL. If that page loads data asynchronously, replace #ready with a selector or signal that only appears after the required data and rendering are complete. A visible marker is an example, not a universal guarantee that fonts, images, or every animation have finished.
Capture the full page or one element
Full document screenshot
Use chromedp’s FullScreenshot when you need the document beyond the viewport. Its documented quality range is 0–100: quality 100 produces PNG, while other values produce JPEG. Match the filename extension to the encoded format.
Rank #2
- Connect Classic RCA Devices to HDMI Displays: Bring older AV equipment back into use by converting yellow, white and red composite RCA signals into HDMI output for newer TVs, monitors and projectors. Choose between 720P and 1080P output at 60Hz to match your display. Please note that this av to hdmi adapter is built specifically for connecting an RCA/AV source to an HDMI display; it cannot convert an HDMI source to RCA/AV.
- Complete 3-Cable Set Included: Includes separate RCA, HDMI and Micro USB cables for video/audio connection, HDMI output and power. The RCA and HDMI cables are detachable for flexible placement and use with compatible equipment. USB power is required for operation. A Micro USB cable is included; a 5V/1A power adapter is not included.
- Selectable 720P and 1080P Output: Use the built-in resolution switch to select 720P or 1080P output at 60Hz based on your TV or monitor. No software or drivers are required. Connect the RCA source, HDMI display and USB power, then select the desired output resolution.
- Compatibility with Legacy AV Devices: Compatible with RCA-output VCRs, VHS players, DVD players, set-top boxes and karaoke systems, as well as compatible PS1, PS2, PS3, Xbox, Wii, N64, SNES and GameCube systems using RCA/AV output. Supports PAL, NTSC3.58, NTSC4.43, SECAM, PAL/M and PAL/N analog input formats.
- HDMI Output Based on the Original Source:Converts an analog RCA signal to HDMI output with selectable resolution up to 1080P. The av to hdmi converter changes the signal format but does not turn lower-resolution VHS footage or classic game graphics into native HD content. Final picture quality depends on the original source, connected equipment and display. For stable operation, connect the included USB power cable to a 5V/1A USB power source.
var image []byte
err := chromedp.Run(ctx,
chromedp.Navigate(dataURL),
chromedp.WaitVisible("#ready", chromedp.ByID),
chromedp.FullScreenshot(&image, 100),
)
if err != nil {
return err
}
return os.WriteFile("full-page.png", image, 0600)
The chromedp screenshot example warns that full-page capture overrides device emulation settings. If precise viewport or device-emulation geometry matters, check the resulting dimensions and rendering rather than assuming full-page capture preserves those settings.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Element screenshot
The chromedp example also demonstrates capturing a selected element. A selector-based capture is useful when the output should contain a component rather than the whole page; adapt the selector and wait condition to the element you need.
Rank #3
- Convert your VHS tapes to DVD or digital to enhance and preserve your home movies
- Capture analog video directly from your camcorder or VCR and burn to DVD or convert to popular digital formats to share freely across devices
- Trim video, make quick edits, enhance color, add transitions, reduce noise and stabilize old footage to breathe new life into your old videos
- Complete your video experience by selecting from creative, customizable DVD menu templates, or creating personalized disc labels
- Get 2 DVDs for your first projects: An Amazon exclusive extra
var image []byte
err := chromedp.Run(ctx,
chromedp.Navigate(dataURL),
chromedp.WaitVisible("#ready", chromedp.ByID),
chromedp.Screenshot("#ready", &image, chromedp.NodeVisible, chromedp.ByID),
)
if err != nil {
return err
}
return os.WriteFile("element.png", image, 0600)
Element screenshots in Chrome involve protocol commands that chromedp does not send, according to the chromedp package documentation. Check behavior against your Chrome version and target page; if the exact element capture path does not work as expected, capture the viewport or full page and crop the result in a separate image-processing step.
Make dynamic pages ready before capture
A successful navigation does not necessarily mean a single-page app has finished fetching data or painting the content you want. Choose a readiness condition based on the page:
Rank #4
- Composite to HDMI Converter: Converts analog AV composite (Yellow, White, Red) input to HDMI 720P/1080P (60HZ) output, displayed on smart TV, Projector or HD Display, which bring back your old and cherish memories.
- Plug to Play: This HDMI Converter no extra drivers need, just plug and play,easy to use. Please hook up the USB Power Cable (included) to 5V power source during use. Note: The Video Converters only support converts AV to HDMI, can't converts HDMI to AV.
- Widely Used: This composite to hdmi adapter is widely applied to PS1, PS2, PS3, Xbox, N64, Wii, STB, VHS, VCR, DVD Players and other devices with standard composite AV input. Note: It can only be used when PS2 is set to RGB output.
- Wide Compatibility: This Video Audio Converter Adapter supports source formats of PAL, NTSC3.58, NTSC4.43, SECAM, PAL/M, PAL/N standard TV. Provide advanced signal processing with great precision, colors, resolutions, and details. Important Note: This converter can't improve video quality!
- Attention & Package: Please ensure to connect this av hdmi converter to power source to make it work. Package include: 1*AV to HDMI Adaptor, 1*USB Power Cable(adapter not included), 1*User Manual.
- Known element: wait for a selector that appears only after the content is rendered.
- Application state: expose a page-specific marker or completion signal once the data and layout are ready.
- Known delay: use a delay only when the page has a predictable timing requirement; fixed sleeps can be either wasteful or too short.
- Assets: if the image depends on fonts or images, make sure those resources have loaded before capturing. Do not assume that one visible selector proves every asset is ready.
There is no universal wait condition for every page. Validate your chosen condition against the page and content being rendered, especially when network timing, animation, or client-side rendering can vary.
Set output format, dimensions, and destination
Choose capture geometry before choosing where to save the result. A viewport screenshot represents the visible browser area; a full-page screenshot includes content beyond it; an element screenshot targets a selected node. The chromedp full screenshot quality parameter controls encoding as documented by the package: 100 yields PNG, and other values in the documented 0–100 range yield JPEG. The example above uses viewport capture, which returns PNG bytes.
Best Value
- 2-in-1: vhs to digital converter & rca to hdmi converter! Digitize & Convert Simultaneously,Uniquely designed for both VHS to digital conversion and RCA to HDMI display output! Capture your old VHS tapes, VCRs, or PS2/Wii games to your computer via USB/Type-C port, while simultaneously viewing them in real-time on HDMI TVs/monitors. No need to buy separate devices—perfect for archiving family memories or retro gaming.
- USB-A & USB-C Dual Inputs for Universal Compatibility This VCR to digital converter Works with any computer! Connect via USB-A (for older PCs) or USB-C (for MacBook/Modern Laptops). Capture analog signals from VHS/DVD players, Hi8 cameras, or game consoles (PS2/Wii) and save them as MP4 files.
- Preserve Precious Memories in Digital Formats Rescue fading VHS tapes and convert them to digital files (1080p) for permanent storage or sharing. Compatible with a wide range of open capture software, supports batch conversion, clip editing, and direct upload to YouTube/Facebook. Ideal for weddings, birthdays, or vintage home videos.
- Usb video capture card for HDMI Live Preview & Multi-Device Support Watch your analog content on modern HDMI displays instantly! Convert RCA/AV signals to HDMI (Switch Function for 720p/1080p) for TVs, projectors, or gaming monitors. Bonus: Use the HDMI loop-through to preview digitization progress while capturing—no more guesswork!
- Retro Tech Revival: From VCRs to Wii Consoles Compatible with VHS/VCR/DVD players, Hi8 camcorders, PS2, Wii, and RCA-based devices. Includes RCA/AV cables and a USB-C adapter. Give your old gear new life—stream classic games, digitize tapes, or connect legacy devices to TVs effortlessly!
Write the returned bytes to a file, return them from an HTTP handler with the corresponding content type, or store them in your chosen object store. Keep the file extension and response content type consistent with the actual encoding. For PDF output or other formats, use the relevant browser or conversion API rather than labeling screenshot bytes as a different format.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Deployment, performance, and cost considerations
Because Chromium performs the render, account for the browser runtime, process lifecycle, timeouts, and resource limits in a service or command-line environment. Set a deadline, handle navigation and capture errors, and decide how many browser tasks can run concurrently within your available CPU and memory. The cited sources do not provide comparative benchmarks or resource figures, so measure your own pages and deployment rather than relying on an assumed throughput.
For repeated captures, consider how you will reuse or restart browser processes, isolate jobs, and restrict what pages can access. Treat user-provided URLs as untrusted input: define network-access and timeout policies appropriate to your application. These are operational and security decisions, not guarantees supplied by the screenshot libraries. Cost depends on where and how you run the browser; the cited package sources do not state hosting costs.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Troubleshoot common capture failures
- Chrome or Chromium cannot start: confirm a browser runtime is installed and accessible in the execution environment, then check the error returned from
chromedp.Run. The Go CDP client does not replace the browser. - The screenshot is blank or missing dynamic content: navigation may have completed before the app rendered. Wait for a page-specific selector or application-ready signal, and verify that the condition corresponds to the content you need.
- The command times out: the page may be slow, blocked, or waiting on resources. Inspect the navigation and readiness steps, then set a timeout that fits the page and service limits instead of removing deadlines entirely.
- Full-page dimensions or emulation differ from expectation: the chromedp example notes that full-page capture overrides device emulation settings. Check output geometry and use viewport capture when the visible viewport is the required result.
- Element capture behaves unexpectedly: Chrome’s element screenshot behavior involves protocol commands chromedp does not send, according to its package documentation. Validate against your target browser or capture a larger region and crop it.
- Output will not open or has the wrong format: ensure the extension and HTTP content type match the bytes. With
FullScreenshot, quality 100 produces PNG; other documented quality values produce JPEG. - Long stitched pages repeat a fixed header: go-rod’s scroll-and-stitch full-page option can repeat fixed-position elements. Inspect the stitched output and account for sticky or fixed UI when selecting a capture method.
Or skip the browser setup
If you want a screenshot without installing and operating Chromium yourself, ScreenshotNeo provides a screenshot API and MCP server. A single GET request can return an image or PDF. Its cleanup step accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.
For an ordinary web page URL, this cURL example saves a WebP image. See the ScreenshotNeo API documentation for request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. Its Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.
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.




