This is actually kind of cool, so I thought I'd share it.
PROBLEM: To create textures for the planes in my 3D bumper video I need to do screen captures of various developerWorks articles in my browser. This is easy. I can use GIMP to capture a section of the screen, but it's just a little slow and I need to get nine images from several different web pages. Must go faster.
SOLUTION: (at least for now) Because I'm selecting the web pages by hand an automated spider wouldn't work for me, but I can still speed up the process. Here's what I did in Ubuntu Linux (12.04)
- Set up the web browser and size it as I like. I will not move this window once I begin.
- Bring up a web page.
- Hit the PrtSc button and save the screenshot as a graphic. I'm naming the files to fit in groups to make my later processing easier.
- Once I have captured the screens that I want, I need to crop them. I'll use GIMP to figure out the parameters, but automate the process.
I make note of the Position and Size parameters, because I'm going to need this for my automation. Since I never moved the browser window and I always did a full screenshot each article will be in the same position in each saved image.
- Now, I apply the magic, ImageMagick to be precise. I use the convert command to process all of these images at once:
I've pulled all of my images into the screenshots directory. I want to preserve them because I always try to preserve originals until I'm sure they won't be needed. I'm using ls to get all the file names and piping them through xargs, an incredibly useful tool for passing things from one tool to another. convert, a component of ImageMagick, crops each file, based on the parameters we got from GIMP. All files are cropped perfectly and identically in seconds.
ls screenshots|xargs -iFILE convert screenshots/FILE -crop 935x894+346+172
There is probably a tool somewhere that I can use to download web pages and convert them directly into images. That could save some time, except that I'm still picking the pages by hand to make sure that the are representative of the topic. If I ever do something that's spidering through a page I might do it differently. For now this was pretty handy.