public static byte[] compressModifiedHuffman(final byte[] uncompressed, final int width, final int height) throws ImagingException {
        final BitInputStreamFlexible inputStream = new BitInputStreamFlexible(new ByteArrayInputStream(uncompressed));
        try (BitArrayOutputStream outputStream = new BitArrayOutputStream()) {
            for (int y = 0; y < height; y++) {
                compress1DLine(inputStream, outputStream, null, width);
                inputStream.flushCache();
                outputStream.flush();
            }
            return outputStream.toByteArray();
        }
    }
Compressed with the "Modified Huffman" encoding of section 10 in the TIFF6 specification. No EOLs, no RTC, rows are padded to end on a byte boundary.

@param uncompressed uncompressed byte data
@param width        image width
@param height       image height
@return the compressed data
@throws ImagingException if it fails to write the compressed data
src/main/java/org/apache/commons/imaging/formats/tiff/itu_t4/T4AndT6Compression.java