Use DermAnnotation TIFF files in Python

Use DermTiff to read / write DermAnnotation TIFF files in Python.
Or C++ library libdermtiff is also available.

Annotated file

Overview

DermAnnotation manages annotated files as TIFF files.

The original image information, layer information, and pen information are all saved in the TIFF file.

TIFF file structure

The original image, layer and layer pen information are saved in the following format on each page of the TIFF file.

    The first image is the original image, the second and subsequent images are each layer, and are saved in the following format.

    • For the first image (original image), the original image is saved as it is.
    • For the second and subsequent pixels (layers), each pixel is saved with the same color as the pen in the painted part with an alpha value of 255, and if it is not painted, the alpha value is 0.

    The pen name and color are saved as the name of each page in the following format.

    • The first page name is blank.
    • Save the second and subsequent page names in the format of 'pen name / (R, G, B, 255)'. The pen name is a character string that does not include '/', and RBG is an integer from 0 to 255.

    Save format

    DermAnnotation creates and reads annotation files in the following format.

    • The height and width of all pages are the same, and all pages should be 16384px or less.
    • Images are saved by the scanline method.
    • The ADOBE_DEFLATE method is used as the compression method.
    • Planar Configuration uses the CONTIG method.
    • Bits per sample is 8.
    • Samples per pixel is set to 4, and RGBA is stored.