public void writeImage(BufferedImage src, OutputStream os)
throws ImageWriteException, IOException
{
final PaletteFactory paletteFactory = new PaletteFactory();
final SimplePalette palette = paletteFactory.makePaletteSimple(src, 256);
BinaryOutputStream bos = new BinaryOutputStream(os, BinaryOutputStream.BYTE_ORDER_INTEL);
if (palette == null || bitDepth == 24 || bitDepth == 32)
{
if (bitDepth == 32)
write32BppPCX(src, bos);