URL to Image
URL to image refers to the process of converting a website URL into an image file by capturing a screenshot of the rendered web page. This is accomplished using screenshot APIs or headless browsers that load the page and export it as a PNG or JPEG image, or as a PDF.
How URL to Image Works
When you convert a URL to an image, a headless browser performs these steps:
- Navigates to the specified URL
- Renders HTML, CSS, and JavaScript
- Waits for the page to fully load
- Captures the viewport or full page as an image
- Returns the image in your chosen format
Output Formats
URL to image services typically support multiple output formats. GetScreenshot outputs these three:
PNG
Lossless compression, supports transparency. Best for UI screenshots.
JPEG
Lossy compression, smaller files. Good for photos and general use.
Document format, great for archival and printing.
Example API Call
Converting a URL to image with GetScreenshot:
https://api.rasterwise.com/v1/get-screenshot
?apikey=YOUR_API_KEY
&url=https://example.com
&format=png
The API answers with JSON. The screenshotImage field holds the URL of the image, which is stored for 30 days. Use format=jpeg for a JPEG, or pdf=true for a PDF.
Common Use Cases
- Social sharing: Generate Open Graph images for link previews
- Link galleries: Display website previews in directories
- Documentation: Include website visuals in reports
- Archival: Preserve webpage appearances over time
URL to Image with GetScreenshot
GetScreenshot converts any URL to an image with a simple API call. It outputs PNG or JPEG images, or an A4 PDF, with options for custom viewports, full-page capture, and more.
Try GetScreenshot