[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cropping a large collection of .PNG screenshots



On Wed, Apr 09, 2014 at 03:03:14AM -0700, Kevin O'Gorman wrote:
> I have a few hundred screen shots I want to put on a web page, but
> they are all full-screen and I want to crop to the real contents.
> This is an identical region in all cases.  So I want to script it.
> 
> So, 2 questions:
> A) What's the best tool for the job?  Gimp, irfanview, or something else?
> B) Is there a script already in existence where I can just change the
> crop rectangle?  I really don't want to learn a new language for a
> one-time job.

*IF* you are into perl, then consider perlmagick.
There are examples under the /usr/share/doc/perlmagick/examples/demo/
directory, e.g.

#!/usr/bin/perl
$p = new Image::Magick;
$p->Read("uncropped-screenshot.png");
$p->Crop(geometry=>'80x80+25+50');
$p->Set(page=>'0x0+0+0');
$p->Write("cropped-screenshot.png");

Play around with the geometry parameters until you get the desired
result.

-- 
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the 
oppressing." --- Malcolm X


Reply to: