What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
Just wondering if anyone on the list has suggestions for something I can put into a script to convert a webpage into a file I can use with my screensaver.
c
On 14/08/2013 13:47, Carl T. Miller wrote:
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
Just wondering if anyone on the list has suggestions for something I can put into a script to convert a webpage into a file I can use with my screensaver.
c
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Perhaps use one of the PDF printing tools (where you can print to a PDF file) and then use convert from ImageMagick to convert the PDF file to a graphics format.?
On Wed, Aug 14, 2013 at 2:47 PM, Carl T. Miller carl@carltm.com wrote:
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
Just wondering if anyone on the list has suggestions for something I can put into a script to convert a webpage into a file I can use with my screensaver.
I don't really think this is on topic, but regardless, have a look at phantomjs' [1] rendering capabilities [2].
Ciao
On 14/08/2013 13:59, Leon Jacobs wrote:
I don't really think this is on topic,
I'm assuming he's using Centos and wants a solution to a task he wants to do with it. So possibly tenuously on-topic...
On Wednesday 14 August 2013, "Carl T. Miller" carl@carltm.com wrote:
What is the easiest way to convert a webpage into a jpg or png file?
JPEG isn't an appropriate format for text. I'm not sure about PNG.
On 08/14/2013 04:08 PM, Yves Bellefeuille wrote:
On Wednesday 14 August 2013, "Carl T. Miller" carl@carltm.com wrote:
What is the easiest way to convert a webpage into a jpg or png file?
JPEG isn't an appropriate format for text. I'm not sure about PNG.
I use http://snapito.com/
It stores screenshots in PNG format, and has a really simple API that I call with wget.
On 08/14/2013 09:19 AM, Marios Zindilis wrote:
On 08/14/2013 04:08 PM, Yves Bellefeuille wrote:
On Wednesday 14 August 2013, "Carl T. Miller" carl@carltm.com wrote:
What is the easiest way to convert a webpage into a jpg or png file?
JPEG isn't an appropriate format for text. I'm not sure about PNG.
I use http://snapito.com/
It stores screenshots in PNG format, and has a really simple API that I call with wget.
Do you want do this automagically? If not you could use ksnapshot, then use gimp to remove the surrounding browser junk.
Carl T. Miller wrote:
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
Just wondering if anyone on the list has suggestions for something I can put into a script to convert a webpage into a file I can use with my screensaver.
A script? You could easily take a window capture with the Gimp.
mark
On Wed, Aug 14, 2013 at 09:58:46AM -0400, m.roth@5-cent.us wrote:
Carl T. Miller wrote:
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
If you just need what is on your screen, you could use ImageMagick's import command. You select what you need with the mouse, and save it as an image format, for example
import myshot.jpg
I use firefox extension ScreenGrab - https://addons.mozilla.org/cs/firefox/addon/screengrab-fix-version/
Filip Bartmann
On Wed, 14 Aug 2013 10:16:40 -0400 Scott Robbins scottro@nyc.rr.com wrote:
On Wed, Aug 14, 2013 at 09:58:46AM -0400, m.roth@5-cent.us wrote:
Carl T. Miller wrote:
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
If you just need what is on your screen, you could use ImageMagick's import command. You select what you need with the mouse, and save it as an image format, for example
import myshot.jpg
From: Carl T. Miller carl@carltm.com
To: CentOS centos@centos.org Sent: Wednesday, August 14, 2013 5:47 AM Subject: [CentOS] convert webpage to image
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
I wrote a few lines to do this, but it involves using firefox, and 'import' from ImageMagick.
The first script starts firefox in a virtual frame:
=== Xvfb :2 -screen 0 1280x1024x24 > /dev/null 2>&1 & export DISPLAY=localhost:2.0
firefox http://ip.of.your.page/page.html & ===
Then the second script captures/crops what I want:
=== export DISPLAY=localhost:2.0 import -crop '1024x512+54+235' -window root /path/to/result.png ==
You'll have to adjust the crop values to what you want.
On Wed, 14 Aug 2013 07:20:03 -0700 (PDT) Joseph Spenner joseph85750@yahoo.com wrote:
From: Carl T. Miller carl@carltm.com To: CentOS centos@centos.org Sent: Wednesday, August 14, 2013 5:47 AM Subject: [CentOS] convert webpage to image
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
I wrote a few lines to do this, but it involves using firefox, and 'import' from ImageMagick.
The first script starts firefox in a virtual frame:
=== Xvfb :2 -screen 0 1280x1024x24 > /dev/null 2>&1 & export DISPLAY=localhost:2.0
firefox http://ip.of.your.page/page.html &
Then the second script captures/crops what I want:
=== export DISPLAY=localhost:2.0 import -crop '1024x512+54+235' -window root /path/to/result.png ==
You'll have to adjust the crop values to what you want.
But what if the size of the website is larger than the screen size? I assume the OP wants to "see" the whole website in a single picture, and the website might span more than a single visible screen (and require scrolling to see the whole thing).
All screenshot-related methods would then need to take multiple pictures, scroll the website in the browser a "windowfull" at a time in all directions, and afterwards calculate how to concatenate all those pictures into a big one. While this can be done in principle, I think that any implementation would get Real Ugly Real Soon(tm).
A more reasonable approach would be to have the browser itself dump the image of the site --- the browser is the one actually rendering the thing from html in the first place. Any browser plugins around for this?
Best, :-) Marko
Marko Vojinovic wrote:
On Wed, 14 Aug 2013 07:20:03 -0700 (PDT) Joseph Spenner joseph85750@yahoo.com wrote:
From: Carl T. Miller carl@carltm.com To: CentOS centos@centos.org Sent: Wednesday, August 14, 2013 5:47 AM Subject: [CentOS] convert webpage to image
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
I wrote a few lines to do this, but it involves using firefox, and 'import' from ImageMagick.
<snip>
But what if the size of the website is larger than the screen size? I assume the OP wants to "see" the whole website in a single picture, and the website might span more than a single visible screen (and require scrolling to see the whole thing).
<snip> <ctrl-->, repeat as needed.
mark
On Wed, Aug 14, 2013 at 03:38:33PM +0100, Marko Vojinovic wrote:
But what if the size of the website is larger than the screen size? I assume the OP wants to "see" the whole website in a single picture, and the website might span more than a single visible screen (and require scrolling to see the whole thing).
All screenshot-related methods would then need to take multiple pictures, scroll the website in the browser a "windowfull" at a time in all directions, and afterwards calculate how to concatenate all those pictures into a big one. While this can be done in principle, I think that any implementation would get Real Ugly Real Soon(tm).
A more reasonable approach would be to have the browser itself dump the image of the site --- the browser is the one actually rendering the thing from html in the first place. Any browser plugins around for this?
Among those interactive, the Screengrab Firefox extension does it. Among those non-interactive, phantomjs should do it.
Mihai
On 08/14/2013 11:00 AM, Mihai T. Lazarescu wrote:
On Wed, Aug 14, 2013 at 03:38:33PM +0100, Marko Vojinovic wrote:
But what if the size of the website is larger than the screen size? I assume the OP wants to "see" the whole website in a single picture, and the website might span more than a single visible screen (and require scrolling to see the whole thing).
All screenshot-related methods would then need to take multiple pictures, scroll the website in the browser a "windowfull" at a time in all directions, and afterwards calculate how to concatenate all those pictures into a big one. While this can be done in principle, I think that any implementation would get Real Ugly Real Soon(tm).
A more reasonable approach would be to have the browser itself dump the image of the site --- the browser is the one actually rendering the thing from html in the first place. Any browser plugins around for this?
Among those interactive, the Screengrab Firefox extension does it. Among those non-interactive, phantomjs should do it.
Mihai
phantomjs + rasterize.js (ships with phantomjs in the examples folder) is probably the route that I would go...
https://github.com/ariya/phantomjs/blob/master/examples/rasterize.js
usage: phantomjs rasterize.js http://www.google.com google.png
On Wed, Aug 14, 2013 at 8:47 AM, Carl T. Miller carl@carltm.com wrote:
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
Just wondering if anyone on the list has suggestions for something I can put into a script to convert a webpage into a file I can use with my screensaver.
c
This will do exactly what you want without resorting to hackery or using external services. It has a component to convert to both pdf or an image and uses webkit. http://code.google.com/p/wkhtmltopdf/
The binaries are standalone and require no special dependencies. The command line is sensitive to the order you place options, but otherwise it works very well.
❧ Brian Mathis
Brian Mathis wrote:
On Wed, Aug 14, 2013 at 8:47 AM, Carl T. Miller carl@carltm.com wrote:
What is the easiest way to convert a webpage into a jpg or png file? I've seen several programs that can do various conversions, but nothing open source that can do it in a single conversion.
This will do exactly what you want without resorting to hackery or using external services. It has a component to convert to both pdf or an image and uses webkit. http://code.google.com/p/wkhtmltopdf/
Yes, this looks like a winner. It looks like wkhtmltoimage will do everything I want. Thanks!
c
On Wed, Aug 14, 2013 at 8:47 AM, Carl T. Miller carl@carltm.com wrote:
This will do exactly what you want without resorting to hackery or using external services. It has a component to convert to both pdf or an image and uses webkit. http://code.google.com/p/wkhtmltopdf/
Carl: That's pretty cool! Adding to my list of cool stuff. Thanks for the link!
From: Brian Mathis brian.mathis+centos@betteradmin.com
To: CentOS mailing list centos@centos.org Sent: Wednesday, August 14, 2013 7:59 AM Subject: Re: [CentOS] convert webpage to image
This will do exactly what you want without resorting to hackery or using external services. It has a component to convert to both pdf or an image and uses webkit. http://code.google.com/p/wkhtmltopdf/
Brian: That's pretty cool! Adding to my list of cool stuff. Thanks for the link!
(gave wrong guy credit in previous post. sorry. :)
--------------------------If life gives you lemons, keep them-- because hey.. free lemons. "~heart~ Sticker" fixer: http://microflush.org/stuff/stickers/heartFix.html