[GRLUG] image processing question

john-thomas richards jtr at jrichards.org
Sun May 3 14:01:17 EDT 2009


On Sun, May 03, 2009 at 01:22:03PM -0400, Michael Mol wrote:
> Long story short:
> 1. I have a bunch of HTML snippets.
> 2. I've successfully managed to batch-convert them to PostScript using html2ps
> 3. I can batch-convert them to PNG with ImageMagick, but I wind up
> with a tiny snippet of text on a much larger image.
> 
> I don't need a PNG that scales out to 8.5x11, or any other constant
> size.  What I need is a PNG image that's just large enough to contain
> the text.
> 
> Now, I could load each image into the GIMP and use the auto-crop tool,
> but as you might have guessed by now, my goal is to do everything in
> batches. I'm also not real keen on the idea of writing an autocropper
> in C, but I'd rather do that before delving into the GIMP's Script Fu
> interface.
> 
> Is there an way to batch the automatic cropping of such images?

ImageMagick?  `convert -crop 200x100+300+400 image.png newimage.png'?

That would work if the .png files that result from your other batch processes
need to be the same size.
-- 
john-thomas
------
A democracy cannot exist as a permanent form of government. It can only
exist until the voters discover that they can vote themselves largess
from the public treasury.
Sir Alex Fraser Tytler (1742-1813)


More information about the grlug mailing list