protected void writeImageFileHeader(final AbstractBinaryOutputStream bos, final long offsetToFirstIFD) throws IOException {
        if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
            bos.write('I');
            bos.write('I');
        } else {
            bos.write('M');
            bos.write('M');
        }

        bos.write2Bytes(42); // tiffVersion

        bos.write4Bytes((int) offsetToFirstIFD);
    }
Check an image to see if any of its pixels are non-opaque.

@param src a valid image
@return true if at least one non-opaque pixel is found.
src/main/java/org/apache/commons/imaging/formats/tiff/write/AbstractTiffImageWriter.java