Images (iText 7)

I want to add a text watermark to an image. How can I do that?
When I try to convert a specific tiff file to PDF, the following exception occurs: java.lang.RuntimeException: Scanline must begin with EOL code word. I can open the tiff file in any image viewer, so it's valid.
Recently I am tasked with reducing the file sizes of PDF generated from blank office documents. The images are mostly blank, but they have a variety of company letterheads (in color), borders and footers. Some are generated by software (and therefore have very clean pixels), others are scanned by desktop scanners. Being "blank", what I mean is center part of the page (two inches away from each margin) will be absolutely blank and white.
I am trying to draw lines on image that needs to be added to a document, just like we draw graphics on paint event of any control. How is this done?
I'm trying to get information about scanned images that are saved into PDF files through iText (using Java). I can get width and height (either through Matrix , or through BufferedImage ). The idea was to use the answer here to calculate the DPI, but I am a bit lost.
I am working on a PDF report that contains topics and images (charts), but the images and the text aren't added to the PDF in the order in which I add them in my code.
I'm trying to compress PDFs using iTextSharp. There are a lot of pages with color images stored as JPEGs (DCTDECODE)... so I'm converting them to black and white PNGs and replacing them in the document (the PNG is much smaller than a JPG for black and white format).
I want to mask an image using another image, for example A.jpg should be masked with image B.jpg . But when I try to make the image B a mask, I get a DocumentException .
I have the code in which I add multiple images to a Document object, but this code only adds the last image to the PDF.