URL2PNG Website Screenshots

Cloudinary is a cloud-based service that provides an end-to-end image management solution including uploads, storage, manipulations, optimizations and delivery.

Cloudinary offers a very rich set of image manipulation capabilities. Images can be uploaded to Cloudinary from your servers and directly from users' Web and mobile applications. In addition, Cloudinary can automatically fetch images from remote URLs or social media sites, such as Facebook, and Twitter.

URL2PNG is a fast, reliable screenshots as a Service. Cloudinary provides an add-on for using URL2PNG screenshot creation capabilities, fully integrated into Cloudinary's image management and manipulation pipeline.

With URL2PNG's dynamic website screenshot creation, you can extend Cloudinary's existing set of image uploading sources. When using the URL2PNG add-on, Cloudinary's dynamic URLs can be used to generate screenshot images of public websites and further manipulate them to match your graphic design.

Using URL2PNG

Before you start, if you haven't done so already, please sign-up to a free Cloudinary account. After signing up, you can try the URL2PNG add-on for free and later on subscribe to an add-on plan that best matches your usage requirements.

Generating a screenshot is performed on-the-fly using dynamic Cloudinary transformation URLs. The screenshot is created by the URL2PNG add-on and is then cached and delivered through a fast CDN. The following dynamic URL delivers a dynamically generated website screenshot:

Ruby:
Copy to clipboard
cl_image_tag("https://cnn.com", :type=>"url2png")
PHP:
Copy to clipboard
cl_image_tag("https://cnn.com", array("type"=>"url2png"))
Python:
Copy to clipboard
CloudinaryImage("https://cnn.com").image(type="url2png")
Node.js:
Copy to clipboard
cloudinary.image("https://cnn.com", {type: "url2png"})
Java:
Copy to clipboard
cloudinary.url().type("url2png").imageTag("https://cnn.com");
JS:
Copy to clipboard
cloudinary.imageTag('https://cnn.com', {type: "url2png"}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("https://cnn.com", {type: "url2png"})
React:
Copy to clipboard
<Image publicId="https://cnn.com" type="url2png">

</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="https://cnn.com" type="url2png">

</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="https://cnn.com" type="url2png">

</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Action("url2png").BuildImageTag("https://cnn.com")
Android:
Copy to clipboard
MediaManager.get().url().type("url2png").generate("https://cnn.com");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setType( "url2png").generate("https://cnn.com")!, cloudinary: cloudinary)
1480x3784 PNG (Scaled down)

Signed URLs

Cloudinary's dynamic image manipulation URLs are quite powerful and enable agile web and mobile development. However, due to the potential costs of users accessing unplanned dynamic URLs with URL2PNG screenshot directives, image manipulation add-on URLs are required (by default) to be signed using Cloudinary's authenticated API and with the sign_url parameter set to true.

Note that once a certain version of a screenshot is generated using signed URLs or the authenticated API, all further image manipulations of the same image can be applied using unsigned dynamic Cloudinary URLs.

The following code example generates an image tag with a signed Cloudinary URL by setting the sign_url parameter to true. The image is resized to a 150x200 thumbnail using Cloudinary's fill crop mode applied with the north gravity. As you can see in the example below, the generated Cloudinary URL includes a signature component s--yKpRnGEi--: only URLs with a valid signature that matches the requested image manipulation are approved for on-the-fly image manipulation and delivery.

Ruby:
Copy to clipboard
cl_image_tag("https://cnn.com", :gravity=>"north", :height=>200, :width=>150, :crop=>"fill", :sign_url=>true, :type=>"url2png")
PHP:
Copy to clipboard
cl_image_tag("https://cnn.com", array("gravity"=>"north", "height"=>200, "width"=>150, "crop"=>"fill", "sign_url"=>true, "type"=>"url2png"))
Python:
Copy to clipboard
CloudinaryImage("https://cnn.com").image(gravity="north", height=200, width=150, crop="fill", sign_url=True, type="url2png")
Node.js:
Copy to clipboard
cloudinary.image("https://cnn.com", {gravity: "north", height: 200, width: 150, crop: "fill", sign_url: true, type: "url2png"})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation().gravity("north").height(200).width(150).crop("fill")).signed(true).type("url2png").imageTag("https://cnn.com");
JS:
Copy to clipboard
cloudinary.imageTag('https://cnn.com', {gravity: "north", height: 200, width: 150, crop: "fill", signUrl: true, type: "url2png"}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("https://cnn.com", {gravity: "north", height: 200, width: 150, crop: "fill", type: "url2png"})
React:
Copy to clipboard
<Image publicId="https://cnn.com" signUrl="true" type="url2png">
  <Transformation gravity="north" height="200" width="150" crop="fill" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="https://cnn.com" signUrl="true" type="url2png">
  <cld-transformation gravity="north" height="200" width="150" crop="fill" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="https://cnn.com" sign-url="true" type="url2png">
  <cl-transformation gravity="north" height="200" width="150" crop="fill">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation().Gravity("north").Height(200).Width(150).Crop("fill")).Signed(true).Action("url2png").BuildImageTag("https://cnn.com")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().gravity("north").height(200).width(150).crop("fill")).signed(true).type("url2png").generate("https://cnn.com");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setType( "url2png").setTransformation(CLDTransformation().setGravity("north").setHeight(200).setWidth(150).setCrop("fill")).generate("https://cnn.com", signUrl: true)!, cloudinary: cloudinary)
signed URL

For more details regarding signed URLs, see the following blog post: On-the-fly image manipulations secured with signed URLs.

Note
You can optionally remove the default signed URL requirement for a particular add-on by selecting it in the Allow unsigned add-on transformations section of the Security account settings in the Cloudinary console.

Eager generation

As an alternative to signed URLs, you can eagerly generate and manipulate screenshots using Cloudinary's authenticated explicit API. This way you already use Cloudinary's authenticated API for requesting URL2PNG screenshot creation, therefore, accessing the generated images can be done using regular unsigned Cloudinary URLs.

Ruby:
Copy to clipboard
Cloudinary::Uploader.explicit("https://en.wikipedia.org/wiki/Jpg", 
  :type => "url2png")
PHP:
Copy to clipboard
\Cloudinary\Uploader::explicit(""https://en.wikipedia.org/wiki/Jpg", 
  array("type" => "url2png"));
Python:
Copy to clipboard
cloudinary.uploader.explicit("https://en.wikipedia.org/wiki/Jpg", 
  type = "url2png")
Node.js:
Copy to clipboard
cloudinary.v2.uploader.explicit("https://en.wikipedia.org/wiki/Jpg", 
  { type: "url2png" },
  function(error, result){console.log(result);});
Java:
Copy to clipboard
cloudinary.uploader().explicit("https://en.wikipedia.org/wiki/Jpg", 
  ObjectUtils.asMap("type", "url2png"));
.Net:
Copy to clipboard
var explicitParams = new ExplicitParams("https://en.wikipedia.org/wiki/Jpg"){
  Type = "url2png"};
var explicitResult = cloudinary.Explicit(explicitParams);

The authenticated API call above generates a screenshot of a Wikipedia Web page. Now we can dynamically generate any derived image and thumbnail of the generated screenshot using unsigned Cloudinary delivery URLs. For example:

derived from screenshot

Create website screenshots

As shown in the examples above, a generated screenshot is a full size image. In order to embed a screenshot in your website or mobile application while matching your graphic design, you would need to generate a thumbnail of the original screenshot.

The following code snippet returns a URL for generating and delivering a 150x200 thumbnail of a screenshot generated by the URL2PNG add-on of a Wikipedia page:

Ruby:
Copy to clipboard
cl_image_tag("https://en.wikipedia.org/wiki/jpg", :gravity=>"north", :height=>200, :width=>150, :crop=>"fill", :sign_url=>true, :type=>"url2png")
PHP:
Copy to clipboard
cl_image_tag("https://en.wikipedia.org/wiki/jpg", array("gravity"=>"north", "height"=>200, "width"=>150, "crop"=>"fill", "sign_url"=>true, "type"=>"url2png"))
Python:
Copy to clipboard
CloudinaryImage("https://en.wikipedia.org/wiki/jpg").image(gravity="north", height=200, width=150, crop="fill", sign_url=True, type="url2png")
Node.js:
Copy to clipboard
cloudinary.image("https://en.wikipedia.org/wiki/jpg", {gravity: "north", height: 200, width: 150, crop: "fill", sign_url: true, type: "url2png"})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation().gravity("north").height(200).width(150).crop("fill")).signed(true).type("url2png").imageTag("https://en.wikipedia.org/wiki/jpg");
JS:
Copy to clipboard
cloudinary.imageTag('https://en.wikipedia.org/wiki/jpg', {gravity: "north", height: 200, width: 150, crop: "fill", signUrl: true, type: "url2png"}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("https://en.wikipedia.org/wiki/jpg", {gravity: "north", height: 200, width: 150, crop: "fill", type: "url2png"})
React:
Copy to clipboard
<Image publicId="https://en.wikipedia.org/wiki/jpg" signUrl="true" type="url2png">
  <Transformation gravity="north" height="200" width="150" crop="fill" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="https://en.wikipedia.org/wiki/jpg" signUrl="true" type="url2png">
  <cld-transformation gravity="north" height="200" width="150" crop="fill" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="https://en.wikipedia.org/wiki/jpg" sign-url="true" type="url2png">
  <cl-transformation gravity="north" height="200" width="150" crop="fill">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation().Gravity("north").Height(200).Width(150).Crop("fill")).Signed(true).Action("url2png").BuildImageTag("https://en.wikipedia.org/wiki/jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().gravity("north").height(200).width(150).crop("fill")).signed(true).type("url2png").generate("https://en.wikipedia.org/wiki/jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setType( "url2png").setTransformation(CLDTransformation().setGravity("north").setHeight(200).setWidth(150).setCrop("fill")).generate("https://en.wikipedia.org/wiki/jpg", signUrl: true)!, cloudinary: cloudinary)
150x200 thumbnail

Further image manipulations

Screenshot creation using the URL2PNG Cloudinary add-on can be mixed with any of Cloudinary's rich set of image manipulation capabilities.

For example, the following code first crops a screenshot to 400x400 while rounding its corners, adding a gray border and specifying auto format to enable transparency on the corners. A light shadow is then added to the thumbnails, and finally, an uploaded image named url2png_logo is added as an overlay. The overlay image is rotated and colorized:

Ruby:
Copy to clipboard
cl_image_tag("https://en.wikipedia.org/wiki/jpg", :type=>"url2png", :transformation=>[
  {:radius=>50, :width=>400, :height=>400, :gravity=>"north", :border=>"2px_solid_rgb:999", :crop=>"fill"},
  {:effect=>"shadow:20", :color=>"#ccc"},
  {:angle=>30, :color=>"#ec9800", :effect=>"colorize", :overlay=>"url2png_logo"}
  ])
PHP:
Copy to clipboard
cl_image_tag("https://en.wikipedia.org/wiki/jpg", array("type"=>"url2png", "transformation"=>array(
  array("radius"=>50, "width"=>400, "height"=>400, "gravity"=>"north", "border"=>"2px_solid_rgb:999", "crop"=>"fill"),
  array("effect"=>"shadow:20", "color"=>"#ccc"),
  array("angle"=>30, "color"=>"#ec9800", "effect"=>"colorize", "overlay"=>"url2png_logo")
  )))
Python:
Copy to clipboard
CloudinaryImage("https://en.wikipedia.org/wiki/jpg").image(type="url2png", transformation=[
  {'radius': 50, 'width': 400, 'height': 400, 'gravity': "north", 'border': "2px_solid_rgb:999", 'crop': "fill"},
  {'effect': "shadow:20", 'color': "#ccc"},
  {'angle': 30, 'color': "#ec9800", 'effect': "colorize", 'overlay': "url2png_logo"}
  ])
Node.js:
Copy to clipboard
cloudinary.image("https://en.wikipedia.org/wiki/jpg", {type: "url2png", transformation: [
  {radius: 50, width: 400, height: 400, gravity: "north", border: "2px_solid_rgb:999", crop: "fill"},
  {effect: "shadow:20", color: "#ccc"},
  {angle: 30, color: "#ec9800", effect: "colorize", overlay: "url2png_logo"}
  ]})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .radius(50).width(400).height(400).gravity("north").border("2px_solid_rgb:999").crop("fill").chain()
  .effect("shadow:20").color("#ccc").chain()
  .angle(30).color("#ec9800").effect("colorize").overlay(new Layer().publicId("url2png_logo"))).type("url2png").imageTag("https://en.wikipedia.org/wiki/jpg");
JS:
Copy to clipboard
cloudinary.imageTag('https://en.wikipedia.org/wiki/jpg', {type: "url2png", transformation: [
  {radius: 50, width: 400, height: 400, gravity: "north", border: "2px_solid_rgb:999", crop: "fill"},
  {effect: "shadow:20", color: "#ccc"},
  {angle: 30, color: "#ec9800", effect: "colorize", overlay: new cloudinary.Layer().publicId("url2png_logo")}
  ]}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("https://en.wikipedia.org/wiki/jpg", {type: "url2png", transformation: [
  {radius: 50, width: 400, height: 400, gravity: "north", border: "2px_solid_rgb:999", crop: "fill"},
  {effect: "shadow:20", color: "#ccc"},
  {angle: 30, color: "#ec9800", effect: "colorize", overlay: new cloudinary.Layer().publicId("url2png_logo")}
  ]})
React:
Copy to clipboard
<Image publicId="https://en.wikipedia.org/wiki/jpg" type="url2png">
  <Transformation radius="50" width="400" height="400" gravity="north" border="2px_solid_rgb:999" crop="fill" />
  <Transformation effect="shadow:20" color="#ccc" />
  <Transformation angle="30" color="#ec9800" effect="colorize" overlay="url2png_logo" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="https://en.wikipedia.org/wiki/jpg" type="url2png">
  <cld-transformation radius="50" width="400" height="400" gravity="north" border="2px_solid_rgb:999" crop="fill" />
  <cld-transformation effect="shadow:20" color="#ccc" />
  <cld-transformation angle="30" color="#ec9800" effect="colorize" overlay="url2png_logo" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="https://en.wikipedia.org/wiki/jpg" type="url2png">
  <cl-transformation radius="50" width="400" height="400" gravity="north" border="2px_solid_rgb:999" crop="fill">
  </cl-transformation>
  <cl-transformation effect="shadow:20" color="#ccc">
  </cl-transformation>
  <cl-transformation angle="30" color="#ec9800" effect="colorize" overlay="url2png_logo">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Radius(50).Width(400).Height(400).Gravity("north").Border("2px_solid_rgb:999").Crop("fill").Chain()
  .Effect("shadow:20").Color("#ccc").Chain()
  .Angle(30).Color("#ec9800").Effect("colorize").Overlay(new Layer().PublicId("url2png_logo"))).Action("url2png").BuildImageTag("https://en.wikipedia.org/wiki/jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .radius(50).width(400).height(400).gravity("north").border("2px_solid_rgb:999").crop("fill").chain()
  .effect("shadow:20").color("#ccc").chain()
  .angle(30).color("#ec9800").effect("colorize").overlay(new Layer().publicId("url2png_logo"))).type("url2png").generate("https://en.wikipedia.org/wiki/jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setType( "url2png").setTransformation(CLDTransformation()
  .setRadius(50).setWidth(400).setHeight(400).setGravity("north").setBorder("2px_solid_rgb:999").setCrop("fill").chain()
  .setEffect("shadow:20").setColor("#ccc").chain()
  .setAngle(30).setColor("#ec9800").setEffect("colorize").setOverlay("url2png_logo")).generate("https://en.wikipedia.org/wiki/jpg")!, cloudinary: cloudinary)
combined resized and overlaid screenshot

To learn more about Cloudinary image manipulation options, see Image transformations.

✔️ Feedback sent!

Rate this page: