private PhotometricInterpreterFloat readAndInterpretTIFF(final File target, final float f0, final float f1, final float fNot)
            throws ImagingException, IOException {
        final ByteSource byteSource = ByteSource.file(target);
        final TiffReader tiffReader = new TiffReader(true);
        final TiffContents contents = tiffReader.readDirectories(byteSource, true, // indicates that application should read image data, if present
                FormatCompliance.getDefault());
        final ByteOrder byteOrder = tiffReader.getByteOrder();
        final TiffDirectory directory = contents.directories.get(0);
        if (!directory.hasTiffFloatingPointRasterData()) {
            fail("Internal error, sample file does not have floating-point data " + target.getName());
        }
        final List<PaletteEntry> pList = new ArrayList<>();
        pList.add(new PaletteEntryForValue(fNot, Color.red));
        pList.add(new PaletteEntryForRange(f0, f1, Color.black, Color.white));
        final PhotometricInterpreterFloat pInterp = new PhotometricInterpreterFloat(pList);
        final TiffImagingParameters params = new TiffImagingParameters();
        params.setCustomPhotometricInterpreter(pInterp);
        final BufferedImage bImage = directory.getTiffImage(byteOrder, params);
        if (bImage == null) {
            return null;
        }
        return pInterp;
    }
Reads a TIFF file using a PhotometricInterpreter with entries for the specified range of values and an arbitrary no-data value. If the image is
successfully read, the interpreter instance will be returned.

@param target the specified TIFF file
@param f0     the expected minimum bound or lower
@param f1     the expected maximum bound or higher
@param fNot   an arbitrary non-data value or NaN
@return if successful, a valid photometric interpreter.
@throws ImagingException in the event of an unsupported or malformed file data element.
@throws IOException      in the event of an I/O error
src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointReadTest.java