public String debug() {
        StringBuilder buf = new StringBuilder("");
        buf.append("       name: " + bfName + "\n");
        buf.append("       size: " + bfSize + "\n");
        buf.append(" img offset: " + bfOffset + "\n");
        buf.append("header size: " + biSize + "\n");
        buf.append("      width: " + biWidth + "\n");
        buf.append("     height: " + biHeight + "\n");
        buf.append(" clr planes: " + biPlanes + "\n");
        buf.append(" bits/pixel: " + biBitCount + "\n");
        if ( windowsStyle )
        {
            buf.append("compression: " + biCompression + "\n");
            buf.append(" image size: " + biSizeImage + "\n");
            buf.append("Xpels/meter: " + biXPelsPerMeter + "\n");
            buf.append("Ypels/meter: " + biYPelsPerMeter + "\n");
            buf.append("colors used: " + biClrUsed + "\n");
            buf.append("primary clr: " + biClrImportant + "\n");
        }
        
        buf.append("Color Table" + "\n" + colorTable.toString() + "\n");
        buf.append("Pixel data:\n");
        for (int y = 0; y < biHeight; y++) {
            int index = y * biWidth;
            for (int x = 0; x < biWidth; x++) {
                buf.append(pix[index++] + " ");
            }
            buf.append("\n");
        }
        
        return buf.toString();
        
    }