Programatically Capturing Web pages as Images

I dont normally post blog articles that are reposts of other content, but this email thread answered a question that Ive struggled with, which is how do you render a web page and save it as an image. I do this on HighTechCville, and our Fish4Brains RailsRumble entry a couple of years ago via, but Ive never been happy with that service:

At Sun, 3 May 2009 11:19:17 -0400,Eric Pugh wrote:Cool!

Its one of those things that seems like everybody wants it, but noone has quite figured out. And the various “services” likethumbshots all feel kinda “seedy”, I am always expecting to seeadvertisements for viagra stamped on top of the screenshots andother questionable business practices.

It seems like you should be able to have the pages be render insideof a library such as WebKit, but I guess rendering is veryintertwined with monitor displays and resolutions etc.

I have a research projects that aggregates info about people,events, and organizations and Id love a better solution for linkingin screenshots of the organizations and individuals site. Here is anexample using the thumbshot service for now..:

Here is the text (thanks to Mark Phillips for this):

Khtml2png – “Khtml2png is acommand line program to create screenshots of webpages. It useslibkhtml (the library that is used in the KDE web browser Konqueror).In khtml2png 2.0.5 to 2.5.0, “convert” from the ImageMagick graphicconversion toolkit is used to create the output files in variousimage file formats. 2.6.0 and future development will use the built-inconversion of the Qt library.†– from the Khtml2png website

Pearl Crescent Page Saver – “Pearl Crescent PageSaver†is an extension for Mozilla Firefox that lets you captureimages of web pages. These images can be saved in PNG format or (withFirefox 2) in JPEG format. The entire page or just the visible portionmay be captured. Options let you control whether images are capturedat full size (which is the default) or scaled down to a smaller size.Page Saver uses the canvas feature that was introduced in Firefox 1.5.â€â€“ from the Pearl Crescent Page Saver website

Webkit2png – “Webkit2png is acommand line tool that creates PNG screenshots of webpages. …webkit2png makes use of webkit, the rendering engine used in Safari.â€â€“ from the Webkit2png website This utility is only available for MacOSX because of the dependence on Safari.

Webshot – “WebShot is a programthat allows you to take screenshots and thumbnails of web pages orwhole websites. It comes with a command line interface for advancedusers. The following image formats are supported: JPG, GIF, PNG, BMP.â€â€“ from the WebShot website WebShot uses Internet Explorer as theengine for creating thumbnails of HTML files.

best,Erik Hetzner