Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is compression not supported for PNG?  RSS feed

 
Rohit Kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am simply creating ImageWriter as,

(ImageWriter) ImageIO.getImageWritersBySuffix("png").next();

And then create ImageWriterParam as,

writer.getDefaultWriteParam();

But it gives exception as "Compression not supported" on statement,

param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, PNGs can't be compressed like that; they are not like JPEGs. Given that the only subclasses of ImageWriteParam are BMPImageWriteParam and JPEGImageWriteParam, there's nothing much useful you can do with ImageWriteParam for PNGs.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!