Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.palinacquisition!news.posted.palinacquisition.POSTED!not-for-mail NNTP-Posting-Date: Thu, 18 Aug 2011 22:29:35 -0500 Date: Thu, 18 Aug 2011 20:29:35 -0700 From: Peter Duniho User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: cropping images References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 34 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 50.46.118.188 X-Trace: sv3-jY3P7cCI3OS3fK1HdIMafrPc//3xgoCKGSK6iT0XQ3H6eB9Xdg0ii0+5oCbYzbRjD5cTOUioEb+XsE9!XusNE1mDbUg/OskXn6RyG0BN/i8cTLLRFmi6h0Bn5b+tVoob6Qc5i/4RdNmKoiXS7QUE4KiGYN+x!bXJ9y4fCfr+QSoe2kQt0L3vdtK8yBlwjJSMSYCM16A0= X-Complaints-To: abuse@iinet.com X-DMCA-Complaints-To: abuse@iinet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2874 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7240 On 8/18/11 4:18 PM, Roedy Green wrote: > I have 1200 square PNG images of national flags in various sizes. I > would like to crop them to rectangles. I thought of writing a > one-shot java utility for the purpose, then I wondered if I would be > reinventing the wheel. Suggestions? There are _tons_ of image manipulating programs out there. Nearly all of them support some kind of cropping. The problem I found was that none provided an efficient workflow to deal with a large number of images where each image needed to be cropped differently (or at least, a large number of the set did). Irfanview and ImageMagick are both well-known utilities, and they offer decent batch processing features. But neither allow per-image customization of the batch processing. A few year ago I got tired of cropping thousands of images in Photoshop one at a time (too much clicking), so I wrote a very simple utility to do it for me. The main feature of the tool is that it will crop, optionally scaling the image, with a minimum number of clicks. If you're curious, you can check it out here: http://harveyosity.org/dragncrop/index.html If you know in advance that every image will need the same cropping applied to it, then I think the batch features in the other programs are more likely to suit your needs. Note that since my utility was written using .NET (Windows) and Cocoa (Mac), this is technically entirely off-topic here. If you're looking specifically for a Java implementation, I don't have an answer for that. :) Pete