Can't get TIFF compression to work #1133
-
I'm trying to convert PDF to multi-page TIFF and can't get the compression working. Currently, my code looks like this:
But when looking at the resulting file with IrfanView, it tells me that the file is uncompressed - a 7 page PDF with 170 KB size is inflated to a 250 MB TIF file with 300 dpi density settings. I thought "image.setCompression(...)" should do the trick... Apparently, this seems to be a recurring topic :-) Using Magick.NET Version 9.1.2 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Can you share your input file? The initial size does not mean anything because the image is a vector image and when it is read with ImageMagick it will be changed to a raster image. |
Beta Was this translation helpful? Give feedback.
-
You should not call using (var images = new MagickImageCollection())
{
images.Read("Lorem ipsum dolor sit amet.pdf", new MagickReadSettings
{
Density = new Density(150),
});
images[0].Settings.Compression = CompressionMethod.LZW;
images.Write("test.tif");
} |
Beta Was this translation helpful? Give feedback.
You should not call
SetCompression
but set the compression of the first image in the collection instead.