Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Convert HTML to Image

to get thumbshots of website

8:02 pm on May 25, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 16, 2004
votes: 0


Thumbshots.org provides thumbshots for DMOZ website. I think this feature is very cool.

I want to do the same thing for my link indexing site. Many websites in my directory are not in DMOZ so I cannot only use thumbshots.org's service.

I wonder if Perl can do this: Visit websites automatically and print(save) the homepage of the destination website in Image format.

I think first I need to have Perl visit those site, I know that can be realized by LWP.

Next, I wonder if I shall have perl save the homepage locally and then convert the html page into image format.

Regarding the 2nd step, I have no idea about how to achieve that. I searched Internet and did not find useful information about Convert HTML to Image in Linux.

I know there are some programs can convert HTML to PDF in linux. Can anybody give me a hint how to convert HTML to Image (GIF,PNG,JPEG) in linux?

Thanks a lot!

8:17 pm on May 25, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 12, 2001
votes: 0

Is there any way for Perl to activate the "Print Screen" function in Windows, maybe?
2:58 am on May 27, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 1, 2004
votes: 0

I've been pondering this for a couple of days and the only thing I've come up with is that jk3210 is totally right. I think that you'd have to have a browser or similar software render the page, then read the memory locations of the rendered page image. "Print screen" is already set up to do that, and with a bit of cropping you'd come up with a screen shot. I don't know how to call system functions in a Windows environment, but jk3210 seems to be on the right track.
12:55 pm on May 27, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Oct 4, 2000
votes: 0

If you have access to a Linux box with KDE perhaps khtml2png is what you want?
7:13 pm on May 27, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 16, 2004
votes: 0

Thanks all of you for replies. The motivation I want this function is I think it's good to add snapshot of website to my site.

But I come to realize it is rather hard to do it. Like jk3210 & Josk said, to call browser (either in Windows or in Linux) and then "print" the screent can do that but that's may be slow and resource intensive.

Someone else tells me that if don't want to call browsers, then I have to write my own HTML parser to render the page, to read and then convert HTML directly into image. If that's true, then I think I'd better forget it.

Alexa.com and Thumbshots.org both provide thumbshots for millions of websites, maybe they have their own HTML parser?


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members