Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Yes—you can convert HTML to a PNG, JPEG, or BMP in C# with NReco.ImageGenerator in only a few lines. Install the NReco.ImageGenerator NuGet package, create an HtmlToImageConverter, and call GenerateImage. The important qualification is that NReco is a wrapper around wkhtmltoimage, whose QtWebKit 4.8 engine does not understand many modern CSS3 and JavaScript features. It is convenient for controlled templates and legacy .NET applications, but test every production page before choosing it.
What NReco.ImageGenerator actually does
NReco.ImageGenerator does not implement a browser engine itself. It starts the wkhtmltoimage executable and exposes a .NET API around it. The renderer loads HTML, CSS, images, and JavaScript, then returns image bytes. That design explains both its simple API and its limitations: the output is governed by the version and capabilities of the deployed wkhtmltoimage binary.
The package is intended for .NET applications, including ASP.NET WebForms and MVC. Typical uses include generating a thumbnail of a webpage, turning an HTML invoice or report into an image, and rendering SVG charts or diagrams on a server.
Free tools Windows power users keep installed
One-click scans. No signup required.
Install the package and render your first image
- In Visual Studio, open Tools → NuGet Package Manager → Package Manager Console, or use the NuGet UI.
- Install
NReco.ImageGenerator. - Ensure the wkhtmltoimage executable required by the package can be deployed and launched by the application process.
- Create an
HtmlToImageConverter, callGenerateImage, and write the returned byte array to a file or HTTP response.
using System;
using System.IO;
using NReco.ImageGenerator;
class Program
{
static void Main()
{
var html = String.Format(
"<body style='font-family:Arial'>Hello world: {0}</body>",
DateTime.Now);
var converter = new HtmlToImageConverter();
byte[] jpegBytes = converter.GenerateImage(html, ImageFormat.Jpeg);
File.WriteAllBytes("hello.jpg", jpegBytes);
}
}
Use ImageFormat.Png for PNG output. The API reference documents BMP, JPEG, and PNG formats. PNG is generally the safer choice for text, diagrams, and transparency; JPEG is smaller for photographic content but is lossy.
#1 Best Overall
- AV To HDMI Converter 3.0 - Convert & Upscale RCA / S-Video / Analog Video Input to HDMI (TV or Monitor) at 1080P or 720P - Plug and Play Adapter with No Computer or Drivers Required
- Upscaler Compatible with VCR, VHS, Camcorders, Hi8, Gaming Systems, Set-Top Boxes, DVD Players, & More. RCA/AV/Composite and S-Video Input. HDMI Output. Works with PAL and NTSC. (Important Note: Does NOT Downscale HDMI to RCA/AV/S-Video)
- NEW! Remote Control Included - Fine Tune Your Video's Image Quality By Adjusting Brightness, Contrast, Saturation, Hue, Resolution (1080P or 720P), Aspect Ratio (Preserve Original 4:3 Look with Black Bars or Stretch To 16:9 HD Widescreen To Fill Your TV Screen)
- NEW! S-Video Input - Allows S-Video Input From Camcorder, VCR, DVD Player, & More - Providing The Highest Possible Video Quality From These Sources (S-Video Cable Not Included - RCA/AV Cable Required For Audio Signal)
- Includes 2-Year Warranty & Tech Support from ClearClick, a USA-Based Small Business (Extendable to 3 Years for Free - See User's Manual)
Render a URL or an HTML file
For a page that already exists at a URL or on disk, use GenerateImageFromFile. Despite its name, the input can be a URL as well as a local file path.
using System.IO;
using NReco.ImageGenerator;
var converter = new HtmlToImageConverter();
byte[] pngBytes = converter.GenerateImageFromFile(
"https://example.com/report.html",
ImageFormat.Png);
File.WriteAllBytes("report.png", pngBytes);
External stylesheets, images, fonts, and scripts must be reachable by the renderer. Use absolute URLs for network resources and valid filesystem paths for local resources. A page that works in your desktop browser can still fail on the server if outbound networking, DNS, TLS certificates, authentication, or file permissions differ.
If an external resource fails but the page can still be rendered, the vendor documents this setting:
var converter = new HtmlToImageConverter
{
CustomArgs = " --load-media-error-handling ignore "
};
byte[] bytes = converter.GenerateImageFromFile(
"https://example.com/report.html",
ImageFormat.Png);
Ignoring media errors lets wkhtmltoimage continue, but it can also produce an incomplete image. Use it only when missing media is acceptable and monitor the resulting output.
Rank #2
- 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.
Control dimensions, scaling, and the renderer process
HtmlToImageConverter exposes these principal settings:
| Property | Purpose | Practical use |
|---|---|---|
Width |
Sets the rendered width. | Match a card, thumbnail, or social-image layout. |
Height |
Sets the minimum height. | Reserve space for a fixed-height output. |
Zoom |
Scales rendered content. | Increase or reduce visual scale when CSS dimensions are fixed. |
ExecutionTimeout |
Limits how long the conversion process may run. | Prevent a stalled page from consuming a worker indefinitely. |
CustomArgs |
Adds wkhtmltoimage command-line options. | Pass renderer-specific switches such as media-error handling. |
ToolPath |
Specifies where the executable is located. | Use an explicit deployment directory. |
WkHtmlToImageExeName |
Changes the executable name. | Use a packaged or renamed binary when required. |
ProcessPriority |
Controls the spawned process priority. | Reduce contention on a busy server. |
var converter = new HtmlToImageConverter
{
Width = 1200,
Height = 630,
Zoom = 1.0,
ExecutionTimeout = 60000,
ToolPath = @"C:toolswkhtmltoimage"
};
byte[] image = converter.GenerateImage(html, ImageFormat.Png);
The exact command-line options accepted through CustomArgs depend on the wkhtmltoimage binary you deploy. Keep the executable version consistent between development, staging, and production so that layout changes are reproducible.
Compatibility: the limitation that determines whether it is suitable
NReco’s documentation states that wkhtmltoimage is based on QtWebKit 4.8 and does not support modern CSS3 features such as flexbox and grid, or ES2015 JavaScript. A page built with current responsive frameworks may therefore render with missing layout, incorrect spacing, unexecuted scripts, or fallback styles.
Recommended Free Tools
- Prefer simple block and table layouts when you control the HTML template.
- Inline critical CSS and use absolute URLs for resources.
- Avoid relying on modern JavaScript syntax or browser APIs.
- Test fonts, SVG, pseudo-elements, web fonts, and lazy-loaded images in the actual deployment environment.
- Compare output at every target width; a page that looks correct at one width can overflow at another.
If pixel fidelity for a modern web application is a requirement, a Chromium-based capture service is usually a better technical fit than a QtWebKit renderer. NReco remains attractive when API simplicity, an existing wkhtmltoimage workflow, or compatibility with older .NET applications matters more than current browser standards.
Rank #3
- Input: RCA, Output: HDMI; Converts Analog Composite Input to HDMI 1080p or 720p Output.
- RCA to HDMI Converter - Plug and Play, Easy to Install and Operate, Powered by External USB Cable.
- RCA to HDMI Converter supports connecting HDMI capture card (note that we do not include HDMI capture card).
- Composite to HDMI Converter Widely Applied to PS One, PS2, PS3, N64, WII, WII U, STB, VHS, VCR, Blue-Ray DVD Players Projector (Note: It can only be used when PS2 is set to RGB output).
- AV to HDMI Converter Support PAL, NTSC3.58, NTSC4.43, SECAM, PAL/M, PAL/N tv format.
Deployment on Windows, Linux, macOS, Docker, and modern .NET
The standard package launches wkhtmltoimage as a separate process through System.Diagnostics.Process. Your hosting environment must permit executable files to be deployed and started. Shared ASP.NET hosting, UWP or universal applications, and mobile environments may block that model.
For Linux, macOS, Docker, and modern .NET 6 or .NET 8+ applications, the vendor directs users to NReco.ImageGenerator.LT. The C# API is the same, but wkhtmltoimage must be deployed separately. Treat the binary as a deployment dependency: include it in your image or release package, set its path explicitly when necessary, and verify execute permissions in the container.
A reliable deployment checklist is:
- Confirm the operating system and .NET target are supported by the package variant you selected.
- Install the correct wkhtmltoimage binary for that operating system and architecture.
- Set
ToolPathor make the executable discoverable by the process. - Run the application under the same account used in production and test file, font, and temporary-directory permissions.
- Allow outbound access to every URL the HTML references, or bundle those assets locally.
- Set a finite
ExecutionTimeoutand limit concurrent conversions so child processes cannot exhaust CPU or memory.
Licensing and package age
The official FAQ says free use covers a single-deployment website, intranet or extranet, or an application used internally by a company. External redistribution as an ISV, multiple deployments, and SaaS deployments require a commercial license. The vendor describes an enterprise pack with source code, an extended redistribution/SaaS license, an LT-version license key, one year of email support, and free updates; its page showed a $99 price when crawled, so verify the current price and terms before purchase.
The official page lists NReco.ImageGenerator 1.2.0 changes dated June 15, 2020, including wkhtmltoimage 0.12.6. NuGet metadata also identifies 1.2.0 as last updated on that date and shows compatibility primarily across .NET Framework targets. That maintenance context is another reason to validate security, operating-system, and browser-feature requirements before standardizing on it.
Rank #4
- RCA to HDMI Converter: Converts analog RCA composite (Yellow, White, Red) input to HDMI 720P/1080P (60HZ) output,displayed on HDTV/Monitor,which can bring back your childhood memories.
- Plug to Play: ABLEWE Mini RCA to 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.
- Wide Compatibility: Support 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.
- Widely Used:Widely applied to PS2,PS3,Xbox,N64, WII, STB, VHS, VCR, DVD Players and other devices with standard composite AV input.
- Attention & Package:Please ensure to connect this rca to hdmi converter to power source to make it work.Package include:1*RCA to HDMI Converter,1*usb power cable(adapter not included),1*User Manual.
Production patterns that avoid common surprises
Return an image from ASP.NET
public ActionResult Preview()
{
var html = "<html><body><h1>Preview</h1></body></html>";
var converter = new NReco.ImageGenerator.HtmlToImageConverter
{
Width = 1000,
ExecutionTimeout = 30000
};
var bytes = converter.GenerateImage(
html, NReco.ImageGenerator.ImageFormat.Png);
return File(bytes, "image/png");
}
Keep conversion isolated
Run conversions in a bounded worker pool rather than starting an unlimited process for every request. Queue large batches, apply request-level timeouts, and delete temporary files after successful or failed jobs. Log the input identifier, renderer version, elapsed time, output size, and exception text without logging secrets embedded in URLs or HTML.
Make resource loading deterministic
Use a stable asset host, explicit dimensions for images, and a predictable font installation. Authenticated pages need a renderer-compatible authentication approach; simply opening the URL from a browser session does not transfer cookies to wkhtmltoimage.
Troubleshooting NReco.ImageGenerator
| Symptom | Likely cause | Fix |
|---|---|---|
| Executable not found | wkhtmltoimage is absent or outside the process path. | Deploy the binary and set ToolPath or correct WkHtmlToImageExeName. |
| Access denied or process cannot start | Hosting policy, file permissions, or a blocked child process. | Use an environment that permits System.Diagnostics.Process; grant execute permission and test under the production account. |
| Blank or partial image | Page scripts, CSS, fonts, or images did not load. | Use absolute reachable URLs, inspect server networking, simplify unsupported CSS/JS, and only then consider --load-media-error-handling ignore. |
| Modern layout is broken | QtWebKit 4.8 lacks flexbox, grid, or newer JavaScript support. | Rewrite the capture template for supported features or move to a Chromium-based renderer. |
| Conversion hangs | Slow network resource, script, or page that never settles. | Set ExecutionTimeout, remove blocking resources, and avoid unbounded parallel jobs. |
| Different output on two servers | Different binary, fonts, OS libraries, locale, or viewport settings. | Pin the renderer and deployment image, install the same fonts, and set dimensions explicitly. |
When to choose another screenshot approach
Choose NReco when you need a small C# API around wkhtmltoimage and can design for its older engine. Reconsider it when your pages depend on current CSS, ES2015+ JavaScript, browser login flows, or a platform where spawning native executables is prohibited. The meaningful comparison axes are rendering-engine modernity, CSS and JavaScript compatibility, operating-system support, executable deployment, output formats, API simplicity, and redistribution or SaaS licensing.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsScreenshotNeo is the first alternative to try for a hosted screenshot API: it removes cookie banners, newsletter popups, and chat widgets before capture, bills only clean shots, and offers an MCP server for AI agents. It also avoids shipping wkhtmltoimage binaries with your application.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF. Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP tools—take_screenshot, get_page_info, and capture_pdf—work with Claude, Cursor, and other MCP clients.
For a direct call, see the ScreenshotNeo API documentation:
Best Value
- Convert RCA to HDMI Instantly – BD&M RCA to HDMI Converter easily converts analog RCA/composite AV signals to HDMI output, allowing you to connect older devices to modern HDTVs, monitors, and projectors with clear video and audio quality.
- Wide Device Compatibility – Supports VHS players, VCRs, DVD players, camcorders, retro gaming consoles, and more including PS1, PS2, PS3, Xbox, N64, Wii, and older AV devices with standard RCA output.
- 1080P HDMI Output – Advanced signal processing delivers stable and sharp video output with support for 720P/1080P HDMI resolution, improving compatibility with modern TVs and displays.
- Plug & Play Setup – No drivers or software required. Simply connect the RCA cables, HDMI cable, and included USB power cable for quick and easy installation in minutes.
- Compact & Reliable Design – Lightweight mini converter design makes it perfect for home entertainment setups, retro gaming, travel, or converting old media collections while maintaining stable performance.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The same request in Python:
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
And in 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}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));
ScreenshotNeo includes full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets plus custom viewports, retina scale, PDF controls, custom CSS and JavaScript, click and wait actions, request and resource blocking, headers, cookies, user-agent, authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is available on every plan. Create a free ScreenshotNeo account to try it without a card.
Frequently Asked Questions
Can NReco.ImageGenerator capture a remote URL directly?
Yes. Use GenerateImageFromFile with the URL, provided the renderer can reach the page and all referenced resources.
Which image formats are documented?
The API documents BMP, JPEG, and PNG output through ImageFormat.
Will a flexbox or CSS-grid page render correctly?
Not reliably. NReco uses wkhtmltoimage’s QtWebKit 4.8 engine, which the vendor says does not support modern CSS3 features such as flexbox and grid.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Do I need a commercial license for a SaaS product?
The vendor says SaaS, external redistribution, and multiple deployments require a commercial license. Confirm current terms directly before shipping.
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.

