• 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

Converting BufferedImage bit-depth

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I need to convert a 32-bit PNG (RGB) to an 8-bit (indexed) version, with as little loss in quality as possible, although some is inevitable and accecptable. I've been able to pull this off by using ColorConvertOp to create a compatible destination image with the appropriate (default) IndexedColorSpace and SampleModel and just painting to it, but the dithering on this was terrible.

What I need to do is create my own palette for the destination image, then create the image itself. In the first part I (think) I've been successful, but I'm getting lost in precisely how to create the destination image and get the right data into it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic