Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7251

Re: cropping images

Date 2011-08-19 09:27 -0700
From Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Newsgroups comp.lang.java.programmer
Subject Re: cropping images
References <t77r47tvj51bpkie7a1s7jgc2f3bic6b5t@4ax.com> <HeydnaAZotk9RdDTnZ2dnUVZ_tCdnZ2d@posted.palinacquisition> <alpine.DEB.2.00.1108191129330.13074@urchin.earth.li>
Message-ID <SJidne8DTex6E9PTnZ2dnUVZ_rudnZ2d@posted.palinacquisition> (permalink)

Show all headers | View raw


On 8/19/11 3:36 AM, Tom Anderson wrote:
> [...]
> I suppose your problem is really not manipulating a large number of
> images, but entering a large number of crop rectangles. If you had the
> rectangles in a file already, bash+convert could do the job easily.

Well, the issue is determining what the crop rectangles are.  It's a 
task that needs to be done visually, based on the content of the image. 
  As it happens, I have another more elaborate program I wrote and use 
for web-site construction that does in fact store crop rectangles for 
reuse on the same image later.  But the user still needs to figure out 
what that crop rectangle is once (and that program uses the same basic 
mechanism that I implemented for my much simpler cropping tool).

It's not something you're going to do sitting at a text editor.  You 
need the graphical interface so that you know what portion of the image 
you're selecting.  Batch processing is great, but for per-image 
customization you need a way to generate the input for the batch processing.

Photo editing software provides a way to do the crop selection, but they 
all are like Photoshop, in that with each new image, you have to start 
the entire process from scratch, including opening the image and 
dragging a crop selection tool across the entire image (which itself 
requires at least two click+drag, because there's no reliable way to 
make sure the crop selection starts right at the edge of the image).

Each image involves a large number of UI interactions (clicks or key 
presses), and slows the process down greatly as compared to what 
information the user really needs to provide for that task.

During my whole career, one of the driving tenets behind software I 
design has been that it should minimize user effort.  The UI is ideal 
when the user is required to provide only the minimum input actually 
needed, and for lengthy repetitive tasks this becomes critical.  Asking 
the user to provide (for example) a sequence of a dozen or two inputs, 
where 80-90% of those inputs are identical for each iteration of the 
task is highly inefficient and fails to take advantage of the very thing 
that computers are _really_ good at: handling repetitive tasks without 
complaint.


(Slight tangent:

For me, the whole thing came to a head when I got my parents a digital 
picture frame that had a widescreen aspect ratio, while all our photos 
were (and still are) 4:3.  On a small form factor, every pixel counts 
and it was preferable to crop photos to fit, rather than have them 
reduced to fit, leaving black bars on the sides.  But I had a lot of 
photos to crop.

The initial implementation of the program I wrote took literally an hour 
or two to get working (testament to the rapid development possible with 
managed code environments like .NET and Java…though I have to say, the 
UI portion would have been much more painful to accomplish in Java; with 
.NET WinForms it was trivial).  Cleaning it up to make it more usable by 
others (including my mom :) ) took more time, of course.  But in the 
end, even the first time I used it I wound up saving more time cropping 
the images than it would have cost me to do it all manually in Photoshop.)


> I've occasionally been pained by the absence of an easy way to script
> GUI interactions with images. I spend ages going through holiday
> pictures choosing which of N shots of a scene i want to post on Flickr;
> if i had a simple way of popping up two images and prompting myself to
> click the better one, i could use that as a comparison function in a
> sort, and largely mechanise the decision process.

Well, sounds like a perfect example of something you ought to write 
yourself.  For better or worse, as a programmer I often treat languages 
like Java and C# as scripting languages, writing one-off programs to do 
exactly that sort of thing.  Maybe there's a real scripting language, 
designed for even easier rapid prototyping and development, but Java and 
C# make it so easy (especially once the IDE has started up :) ) that I 
find I might as well stick with the languages I already know.

For what it's worth, the exact kind of feature you're talking about, 
I've seen implemented in custom software for photo portrait studios. 
They use it to help the customer decide which shots to print.

Like my cropping program, I doubt it would take more than an hour or two 
for you to get all the basic functionality working.  And likewise, 
probably the first time you use it you'd save whatever time it's been 
costing you to do it the slow way.  Just do it!  :)

Pete

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

cropping images Roedy Green <see_website@mindprod.com.invalid> - 2011-08-18 16:18 -0700
  Re: cropping images Thomas Richter <thor@math.tu-berlin.de> - 2011-08-19 01:49 +0200
  Re: cropping images Roedy Green <see_website@mindprod.com.invalid> - 2011-08-18 17:34 -0700
    Re: cropping images Tom Anderson <twic@urchin.earth.li> - 2011-08-19 11:28 +0100
      Re: cropping images Roedy Green <see_website@mindprod.com.invalid> - 2011-08-19 17:13 -0700
    Re: cropping images Thomas Richter <thor@math.tu-berlin.de> - 2011-08-19 21:48 +0200
      Re: cropping images Roedy Green <see_website@mindprod.com.invalid> - 2011-08-19 17:14 -0700
        Re: cropping images Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-08-22 13:50 +0100
          Re: cropping images bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-08-22 14:36 +0100
            Re: cropping images Jeff Higgins <jeff@invalid.invalid> - 2011-08-22 10:12 -0400
            Re: cropping images Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-08-22 15:13 +0100
              Re: cropping images bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-08-22 16:19 +0100
  Re: cropping images Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-08-18 21:05 -0500
    Re: cropping images bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-08-19 09:09 +0100
  Re: cropping images Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-08-18 20:29 -0700
    Re: cropping images Roedy Green <see_website@mindprod.com.invalid> - 2011-08-18 23:52 -0700
    Re: cropping images Tom Anderson <twic@urchin.earth.li> - 2011-08-19 11:36 +0100
      Re: cropping images Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-08-19 09:27 -0700
  Re: cropping images "John B. Matthews" <nospam@nospam.invalid> - 2011-08-19 07:31 -0400

csiph-web