VintaSoft Imaging .NET SDK v8.7
In This Topic
    TIFF: Overview
    In This Topic

    Tagged Image File Format (TIFF) is a file format for storing raster graphics images that typically comes from scanners, frame grabbers, and paint- and photo-retouching programs. TIFF file may contain single or multiple pages. TIFF file size cannot be greater than 4Gb.

    Big TIFF is an extension of format in which TIFF file size can be greater than 4Gb.


    VintaSoft Imaging .NET SDK has a set of classes for easy manipulation with TIFF and Big TIFF files.

    SDK supports:



    TiffFile class

    TiffFile class allows to:
    Here is an example that shows how to create new TIFF file in little-endian (Intel) format:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Dim tiffFile1 As New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFileFormat.LittleEndian)
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile tiffFile1 = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile(
            Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFileFormat.LittleEndian);
                    
    


    Here is an example that shows how to load an existing TIFF file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Dim tiffFile1 As New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("multipage.tif")
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile tiffFile1 = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("multipage.tif");
                    
    



    TiffPageCollection class

    TiffPageCollection class allows to:
    Here is an example that shows how to load multipage TIFF file, add JPEG image to the end of TIFF file, insert PNG image at the beginning of TIFF file and remove third page from TIFF file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Dim tiffFile1 As New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("multipage.tif")
    tiffFile1.Pages.Add(New Vintasoft.Imaging.VintasoftImage("image.jpg"))
    tiffFile1.Pages.Insert(0, New Vintasoft.Imaging.VintasoftImage("image.png"))
    tiffFile1.Pages.RemoveAt(2)
    tiffFile1.SaveChanges()
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile tiffFile1 = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("multipage.tif");
    tiffFile1.Pages.Add(new Vintasoft.Imaging.VintasoftImage("image.jpg"));
    tiffFile1.Pages.Insert(0, new Vintasoft.Imaging.VintasoftImage("image.png"));
    tiffFile1.Pages.RemoveAt(2);
    tiffFile1.SaveChanges();
                    
    



    TiffPage class

    TiffPage class allows to:
    The following image compression algorithms are supported for images stored in TIFF page:
    Here is an example that shows how to get the first page of TIFF file as VintasoftImage object:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Dim tiffFile1 As New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("multipage.tif")
    Dim pageImage As Vintasoft.Imaging.VintasoftImage = tiffFile1.Pages(0).GetImage()
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile tiffFile1 = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("multipage.tif");
    Vintasoft.Imaging.VintasoftImage pageImage = tiffFile1.Pages[0].GetImage();
                    
    



    TiffImageFileDirectory class

    TiffImageFileDirectory class allows to:

    TiffTagCollection class

    TiffTagCollection class allows to:
    Tag with ID from the ReadOnlyTiffTagId enumeration cannot be added/modified/removed.


    Here is an example that shows how to add/modify/delete tags of TIFF file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Using tiffFile1 As New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("image-with-tags.tif")
            Dim tags As Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagCollection = tiffFile1.Pages(0).IFD.Tags
            tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.Software, "VintaSoft Imaging .NET SDK v8.2")
            tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.Make, "VintaSoft Ltd.")
            tags.Add(CUShort(&He001), "BarcodeInfo")
            tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.DateTime, "2009:03:03 10:20:05")
            tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.XResolution, New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffRational(100, 1))
            tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.YResolution, New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffRational(100, 1))
            tags.Remove(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.PrintImageMatching)
            tiffFile1.SaveChanges()
    End Using
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    using (Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile tiffFile1 = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile(@"image-with-tags.tif"))
    {
        Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagCollection tags = tiffFile1.Pages[0].IFD.Tags;
        tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.Software, "VintaSoft Imaging .NET SDK v8.2");
        tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.Make, "VintaSoft Ltd.");
        tags.Add((ushort)0xE001, "BarcodeInfo");
        tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.DateTime, "2009:03:03 10:20:05");
        tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.XResolution, 
            new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffRational(100, 1));
        tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.YResolution, 
            new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffRational(100, 1));
        tags.Remove(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.PrintImageMatching);
        tiffFile1.SaveChanges();
    }
                    
    



    TiffTag class

    TiffTag class allows to:
    Here is an example that shows how to add/modify data of the DateTime tag of the first page of TIFF file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    
    Dim tiffFile1 As New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("multipage.tif")
    Dim dateTimeTag As Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTag = tiffFile1.Pages(0).IFD.Tags.Find(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.DateTime)
    If dateTimeTag IsNot Nothing Then
            dateTimeTag.Data = "01/09/2013 11:45:51"
    Else
            tiffFile1.Pages(0).IFD.Tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.DateTime, "01/09/2013 11:45:51")
    End If
    tiffFile1.SaveChanges()
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    
    Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile tiffFile1 = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile("multipage.tif");
    Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTag dateTimeTag = 
        tiffFile1.Pages[0].IFD.Tags.Find(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.DateTime);
    if (dateTimeTag != null)
        dateTimeTag.Data = "01/09/2013 11:45:51";
    else
        tiffFile1.Pages[0].IFD.Tags.Add(Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffTagId.DateTime, "01/09/2013 11:45:51");
    tiffFile1.SaveChanges();