Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4200154
Votes 8
Synopsis No difference between BILINEAR and BICUBIC interpolation methods
Category java:classes_2d
Reported Against 1.2 , merlin-beta
Release Fixed 1.5(tiger)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs 4475238 , 4918495
Submit Date 30-DEC-1998
Description
Setting the RenderingHints KEY_INTERPOLATION to BILINEAR or BICUBIC produces the 
exact same output, as illustrated by the following code segment. Test has been run with several types of images, from graphics (e.g. Duke image) to photos.

      BufferedImage bilinear = new BufferedImage(2*w, 2*h,
BufferedImage.TYPE_INT_RGB);
      BufferedImage bicubic = new BufferedImage(2*w, 2*h,
BufferedImage.TYPE_INT_RGB);

      Graphics2D bg = bilinear.createGraphics();
      bg.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
      bg.scale(2, 2);
      bg.drawImage(duke, 0, 0, null);
      bg.dispose();

      bg = bicubic.createGraphics();
      bg.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
      bg.scale(2, 2);
      bg.drawImage(duke, 0, 0, null);
      bg.dispose();

      for(int i=0; i<2*w; i++)
 for(int j=0; j<2*h; j++)
   if(bilinear.getRGB(i, j) != bicubic.getRGB(i, j))
     System.out.println("Interpolation algo differ");
Work Around
N/A
Evaluation
We currently have a hint for bicubic but no support in the code for it.
 xxxxx@xxxxx  2001-06-27

Added AffineTransformOp.TYPE_BICUBIC constant.  We are now honoring the
BICUBIC RenderingHint in our image pipeline as well.
 xxxxx@xxxxx  2003-08-06
Comments
  
  Include a link with my name & email   

Submitted On 16-FEB-2000
kuhse
Well, they're RenderingHints and not RenderingGuarantees.


Submitted On 02-JUL-2001
kentyman23
kuhse: yes, but why have a hint that can NEVER happen.  i 
think if a system can support them (and why couldn't they?) 
then they should be used if the hint is set...


Submitted On 03-JUL-2001
kentyman23
please fix for 1.4 (it's been a bug since 1.2!), and it is 
very much needed.  Bicubic interpolation algorithms are in 
nearly every good graphics book.  Also, why no hint for 
biquadratic, it too much like bilinear or bicubic?


Submitted On 25-JUL-2001
kentyman23
this is a big show-stopper for me.. PLEASE implement, it's 
trivial if you have a graphics book


Submitted On 10-AUG-2001
kentyman23
nearly 3 years and this bug still hasn't been fixed.. *sigh*


Submitted On 28-AUG-2001
kentyman23
if the reason for not implementing this is that it is too 
slow, IMPLIMENT IT ANYWAY!  what looks worse: having 
something that goes slow because it is computationaly 
intense, or having an option that when you use it uses a 
DIFFERENT option... this seems like a no brainer... is 
there a way *I* can write this code and submit it to you?  
i'm getting really tired of this


Submitted On 23-FEB-2002
dmitri_don
I can't belive it's still not implemented :(


Submitted On 24-APR-2002
newtonpm
There is a new bug in 1.4, this hint breaks scaling :0


Submitted On 25-JUN-2002
kentyman
*sigh*


Submitted On 08-SEP-2002
woadams
Really don't want to use getScaledInstance(width,height,16).
Please allow BufferedImages to be scaled bicubically! IMHO 
using BufferedImages has lost the scaling quality that was 
previously available with AreaAveragingScaleFilter. In other 
words is not backwards compatible.


Submitted On 10-FEB-2004
WesLaMarche
Any one know if this has been looked at since?


Submitted On 09-MAY-2004
woutervp
In version 1.4.2 it is still not working. A shame !


Submitted On 14-JUL-2005
wwwrun
In fact, it looks like the default is bicubic, not bilinear. Check with screenshots. Screenshots which are downscaled using bilinear scaling look ok, with bicubic they look like crap. The images rather look as if they were scaled bicubic than bilinear.


Submitted On 26-NOV-2005
mhhdudu
Yes, it's still in there!!! It works for .getScaledInstance(width, height, Image.SCALE_SMOOTH) but then I seem to have some problem with certain images which just turn out black using the getScaledInstance method.



PLEASE NOTE: JDK6 is formerly known as Project Mustang