BMP to Multi TIFF with LZW compression

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
worship668
Posts: 3
Joined: 2016-03-10T07:40:37-07:00
Authentication code: 1151

BMP to Multi TIFF with LZW compression

Post by worship668 »

Dear Engineer:

I have a question how to convert some BMP file to One Multipage TIFF with LZW compression? I search as far as I can, and the following code are what I did, but didn't work, Please help:

using (ImageMagick.MagickImageCollection images = new ImageMagick.MagickImageCollection())
{
List<string> strImageList = CommonMethod.GetImageArray(@"C:\temp\");
for (int i = 0; i < strImageList.Count; i++)
{
ImageMagick.MagickImage myMagickImage = new ImageMagick.MagickImage(strImageList);
myMagickImage.SetDefine(ImageMagick.MagickFormat.Tiff, "compress", "LZW");
images.Add(myMagickImage);
}

string strFilePathName = @"C:\temp\image.tiff";
images.Write(strFilePathName);
return true;
}
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: BMP to Multi TIFF with LZW compression

Post by fmw42 »

In command line, it would be

convert image1.bmp image2.bmp image3.bmp ... -compress lzw result.tif

Sorry, but I do not use your API.

Also always provide your IM version and platform when asking questions.
worship668
Posts: 3
Joined: 2016-03-10T07:40:37-07:00
Authentication code: 1151

Re: BMP to Multi TIFF with LZW compression

Post by worship668 »

Hi Fmw42:

thank you very much for your quick reply, I use visual studio and download the Magick.net-Q16-x64.Sample
version 7.0.0103 through NuGet. I just download ImageMagick-6.9.3-7-Q16-x64-dll.exe from website and install it on my PC, and run command line is working. I got a question is that do I have to install the mageMagick-6.9.3-7-Q16-x64-dll.exe on the customer's PC or can I package some file into my software installer so I can run command Line in my code?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: BMP to Multi TIFF with LZW compression

Post by fmw42 »

Sorry I do not know the answer. I am not a developer. You may want to discuss packaging Imagemagick for distribution of your code on the Developer's forum.
Post Reply