[GRLUG] image processing question

Michael Mol mikemol at gmail.com
Sun May 3 14:36:19 EDT 2009


On Sun, May 3, 2009 at 2:01 PM, john-thomas richards <jtr at jrichards.org> wrote:
> 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.

Doesn't quite work that way, because each interesting portion of the
image is a different size. (Though I think they all have the same
upper-left bounding box coordinate.)

-- 
:wq


More information about the grlug mailing list