• 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 Degradation

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Someone tell me if this looks like a good way to pull an image and resize from database with minimal degradation. If there is something I could be doing that will increase the quality of output let me know.

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's just the nature of image scaling that there is going to be some loss of information. java.awt.Image has a method, getScaledImage(), which gives you some control over the quality of the scaling through the third parameter, hints. Unfortunately it does not return a BufferedImage, so it is still necessary to create a BufferedImage instance and paint the image onto its Graphics instance. I don't know if this would give you better or worse results than your current code. Try it both ways and compare the results.
 
reply
    Bookmark Topic Watch Topic
  • New Topic