Tools to Capture and Convert the Web

How to create High Definition Screenshots?

Occasionally you may want to create high definition or retina screenshots. To do this create an image capture with a width larger than the browser width. GrabzIt then scales the browser to stop the image being stretched. High Definition screenshots are slower and become even slower with larger dimensions for this reason it is recommended not to create too large an image. As such you will probably also need to specify a delay to give the screenshot chance to render.

Measurements taken when creating high definition screenshots are inaccurate, which is why full-length screenshots are not always perfectly sized in this mode and high definition is not currently available when targeting elements.

The following code shows how to make a high definition screenshot in each language, notice how the output width is double the size of the browser width.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
ImageOptions options = new ImageOptions();
options.BrowserWidth = 1024;
options.BrowserHeight = 768;
options.OutputWidth = 2048;
options.OutputHeight = 768;
grabzIt.URLToImage("https://www.bbc.co.uk", options);
grabzIt.SaveTo("images/result.jpg");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
ImageOptions options = new ImageOptions();
options.setBrowserWidth(1024);
options.setBrowserHeight(768);
options.setWidth(2048);
options.setHeight(768);
grabzIt.URLToImage("https://www.bbc.co.uk", options);
grabzIt.SaveTo("images/result.jpg");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.3.0/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("https://www.bbc.co.uk", 
{"bwidth":1024,"bheight":768,"width":2048,"height":768}).Create();
</script>
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
var options = {"browserWidth":"1024","browserHeight":"768","width":"2048","height":"768"};
client.url_to_image("https://www.bbc.co.uk", options);
client.save_to("images/result.jpg", function (error, id){
    if (error != null){
        throw error;
    }
});
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = GrabzItImageOptions->new();
$options->browserWidth(1024);
$options->browserHeight(768);
$options->width(2048);
$options->height(768);
$grabzIt->URLToImage("https://www.bbc.co.uk", $options);
$grabzIt->SaveTo("images/result.jpg");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = new \GrabzIt\GrabzItImageOptions();
$options->setBrowserWidth(1024);
$options->setBrowserHeight(768);
$options->setWidth(2048);
$options->setHeight(768);
$grabzIt->URLToImage("https://www.bbc.co.uk", $options);
$grabzIt->SaveTo($filepath);
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzItImageOptions.GrabzItImageOptions()
options.browserWidth = 1024
options.browserHeight = 768
options.width = 2048
options.height = 768
grabzIt.URLToImage("https://www.bbc.co.uk", options)
grabzIt.SaveTo("images/result.jpg")
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzIt::ImageOptions.new()
options.browserWidth = 1024
options.browserHeight = 768
options.width = 2048
options.height = 768
grabzItClient.url_to_image("https://www.bbc.co.uk", options)
grabzItClient.save_to("images/result.jpg")

On the left is an example of a standard screenshot and on the right is a high definition screenshot produced by the code above, both screenshots have the same height.

Try all our premium features for free with a 7 day free trial. Then from $5.99 a month, unless cancelled.
  • More Captures
  • More Features
  • More API's
  • Bigger Scrapes
  • Bigger Captures
  • Bigger Everything
Start Free Trial