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

    JBIG2 is an image compression standard for bi-level images and it is suitable for both lossless and lossy compression.
    JBIG2 compression in lossless mode can compress bi-level image 2-5 times effectively than CCITT Fax Group 4 compression.
    JBIG2 compression in lossy mode can compress bi-level image 5-10 times effectively than CCITT Fax Group 4 compression.


    VintaSoft JBIG2 .NET Plug-in has a set of classes for easy manipulation with JBIG2 images.

    Jbig2File class

    Jbig2File class allows to:
    Here is an example that shows how to create new JBIG2 file in big-endian format:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging.Jbig2Codec
    
    Dim jbig2Doc As New Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File()
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging.Jbig2Codec
    
    Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File jbig2Doc = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File();
                    
    


    Here is an example that shows how to load an existing JBIG2 file:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging.Jbig2Codec
    
    Dim jbig2Doc As New Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File("document.jb2")
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging.Jbig2Codec
    
    Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File jbig2Doc = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File("document.jb2");
                    
    


    Jbig2PageCollection class

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


    Jbig2Page class

    Jbig2Page class allows to:
    Here is an example that shows how to get the first page of JBIG2 file as Image:
    ' The project, which uses this code, must have references to the following assemblies:
    ' - Vintasoft.Imaging
    ' - Vintasoft.Imaging.Jbig2Codec
    
    Dim jbig2Doc As New Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File("document.jb2")
    Dim pageImage As Vintasoft.Imaging.VintasoftImage = jbig2Doc.Pages(0).GetImage()
                  
    
    // The project, which uses this code, must have references to the following assemblies:
    // - Vintasoft.Imaging
    // - Vintasoft.Imaging.Jbig2Codec
    
    Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File jbig2Doc = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Jbig2.Jbig2File("document.jb2");
    Vintasoft.Imaging.VintasoftImage pageImage = jbig2Doc.Pages[0].GetImage();