.NET Multipage Tiff with Lossy Compression

I need a way to take multiple jpg and convert them to one multi-page Tiff. I have work using GDI +, but it only works with LZW compression, which is lossless. This means that my 3 50KB Jpgs turn into a 3MB multi-page Tiff file. This is not what I can take for the software I'm working on.

I know that the Tiff Image format can use the JPG compression scheme, but GDI + does not seem to support this.

If someone knows how to do this in .NET (C #) or any component that performs this conversion.

+3
source share
2 answers

BitMiracle LibTiff.net JPG ( Tiff), tiff. , , ; ( ). LGPL. ( > 2 , )

, . , , .

+3

Atalasoft, .NET, .

public void CombineIntoTiff(string outputTiff, params string[] inputFiles)
{
    using (FileStream stm = new FileStream(outputTiff, FileMode.Create)) {
        TiffEncoder enc = new TiffEncoder();
        enc.Compression = TiffCompression.JpegCompression;
        enc.Append = true;
        foreach (string file in inputFiles) {
            AtalaImage image = null;
            try { image = new AtalaImage(file); } catch { continue; }
            enc.Save(image);
        }
    }
}

, , , TIFF JPEG, , , / . , JPEG, TIFF , TIFF. JPEG.

+1

Source: https://habr.com/ru/post/1747892/


All Articles