• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Image scaling challenge

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an app that needs to read a jpeg and output a scaled version with the highest quality possible. The client is very particular that it should be a very high quality scale. We are using the output from photoshops scaling operation as a benchmark. The best I have done so far is to invoke getScaledInstance on a BufferedImage. Can anyone do better than the links below? One is the original, one is the output from photoshop and one is the output from java. Scaling is done with a width of 94. You can see the java is close, but there are still unwanted artifacts (look close and switch between the two and you will see). Any code on a better solution would be greatly appreciated!
http://9mmedia.com/original.jpg
http://9mmedia.com/javaScaled.jpg
http://9mmedia.com/photoshopScaled.jpg
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if it would be better in these particular circumstances, but this ImageJ plugin implements a fancy cubic spline-based resize algorithm, which does a much better job than linear interpolation.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using JAI may get better result.

http://java.sun.com/products/java-media/jai/
https://jai.dev.java.net/
reply
    Bookmark Topic Watch Topic
  • New Topic