Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #14646
| From | Dangling Pointer <dpointer2@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Bicubic interpolation suddenly is no better than bilinear. |
| Date | 2012-05-19 09:13 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <9d143d01-dcf4-4343-9477-3ffbcd3027e1@ra8g2000pbc.googlegroups.com> (permalink) |
| References | <d389e99e-2fc7-40dd-b07d-90140db4f380@w19g2000yqb.googlegroups.com> <nospam-B8112C.07265719052012@news.aioe.org> <fcd6a322-426d-40c7-af97-f4bd62addd5e@h10g2000pbi.googlegroups.com> |
Well, I can confirm that something's hinky. I've now tested
downsampling a fairly noisy 9600x5400 image to 1280x720 in each of the
following ways:
* With Photoshop, using bicubic resampling.
* With Java, using the process of repeatedly halving the size of the
input with AffineTransformOp and then making the final rescale when
the input is less than or equal to twice the size of the
destination, and using each of:
* TYPE_NEAREST_NEIGHBOR
* TYPE_BILINEAR
* TYPE_BICUBIC
* RenderingHints with interpolation set to bicubic and render set
to quality.
* With Java, using Graphics.drawImage and RenderingHints set to
bicubic/quality
* With Java, using getScaledInstance with SCALE_AREA_AVERAGING
The results were:
Best quality: Photoshop and SCALE_AREA_AVERAGING are about on a par
and heads and shoulders above the rest.
Next: iterative rescaling using either TYPE_BILINEAR, TYPE_BICUBIC, or
RenderingHints bicubic/quality (three-way tie).
Then: iterative rescaling using TYPE_NEAREST_NEIGHBOR and drawImage
using bicubic/quality (two-way tie).
I'm no longer sure that there's a change from the earlier operation of
this particular Java install. On closer inspection of older outputs of
similar code, I don't see a quality difference with iterative
"bicubic" rescaling when the downsampling ratio and input noisiness
were comparable; the better results were from less-noisy input images
and/or larger downsampling ratios (e.g. a 64x48 thumbnail from a
4000x3000 TIF).
Still, something is wrong. Iterative BILINEAR rescaling is *supposed*
to achieve comparable quality to SCALE_AREA_AVERAGING, and bicubic is
supposed to run rings around BILINEAR for quality in turn. So
iterative BILINEAR should be as good as SCALE_AREA_AVERAGING and
iterative BICUBIC should be better still. Instead, they're equal to
each other and significantly worse than SCALE_AREA_AVERAGING.
On the positive side, SCALE_AREA_AVERAGING doesn't seem to be as slow
in Java 6 as it is reputed to be (possibly this reputation is based on
the performance of older versions). So I'll be using that for now.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Bicubic interpolation suddenly is no better than bilinear. Dangling Pointer <dpointer2@gmail.com> - 2012-05-18 22:58 -0700
Re: Bicubic interpolation suddenly is no better than bilinear. Roedy Green <see_website@mindprod.com.invalid> - 2012-05-18 23:12 -0700
Re: Bicubic interpolation suddenly is no better than bilinear. Roedy Green <see_website@mindprod.com.invalid> - 2012-05-20 22:23 -0700
Re: Bicubic interpolation suddenly is no better than bilinear. "John B. Matthews" <nospam@nospam.invalid> - 2012-05-19 07:26 -0400
Re: Bicubic interpolation suddenly is no better than bilinear. Dangling Pointer <dpointer2@gmail.com> - 2012-05-19 08:07 -0700
Re: Bicubic interpolation suddenly is no better than bilinear. Dangling Pointer <dpointer2@gmail.com> - 2012-05-19 09:13 -0700
Re: Bicubic interpolation suddenly is no better than bilinear. Jan Burse <janburse@fastmail.fm> - 2012-05-19 20:48 +0200
Re: Bicubic interpolation suddenly is no better than bilinear. "John B. Matthews" <nospam@nospam.invalid> - 2012-05-20 09:02 -0400
Re: Bicubic interpolation suddenly is no better than bilinear. BGB <cr88192@hotmail.com> - 2012-05-20 11:59 -0500
csiph-web