I'm searching for a method to save a small monochrome Bitmap to a 1bpp PNG file. By default, the bitmap.compress(CompressFormat.PNG, 100, os)
produces a 32bpp PNG file having only 2 colors, and about twice the size of the same PNG using 1bpp.
I saw a method using BufferedImage and a colour table, but the BufferedImage is not available in Android.
Worst case, I can use the DeflatorOutputStream (which is also half the size of the 32bpp PNG), though I'd rather be using a PNG if possible.
I've also had a quick try at using the PNGJ library, but I can't instantiate the ImageInfo (results in java.lang.NoClassDefFoundError: ar.com.hjg.pngj.ImageInfo, so I believe I have to sort out my classpaths).
Any tips? First choice is to do it without PNGJ, second is with PNGJ. This is my first time using Java & Eclipse, so please excuse my ignorance.
Thanks! -James