freeimage icon indicating copy to clipboard operation
freeimage copied to clipboard

Creating multipage TIFF file with differing compressions on each page

Open dynarithmic opened this issue 7 years ago • 0 comments

I am trying to get FreeImage to work with the multipage API calls, but I have not been able to create a multipage TIFF file, where each page is a different compression. For example, the first page may be LZW, the next page might be Group4 fax compression, etc. I have had no luck so far.

I have only been able to successfully create a multipage TIFF file, but the entire file uses one compression type. I have tried a combination of FreeImage_OpenMultiBitmap, FreeImage_AppendPage, FreeImage_SaveMultiBitmapToHandle, etc.. However as stated before, I can't produce a multipage TIFF file that has differing compression schemes used for each page.

The "flags" parameter denoting the compression to use either is placed on FreeImage_OpenMultiBitmap and Free_CloseMultiBitmap, but no such flags parameter exists for FreeImage_AppendPage (which would have been ideal).

Before anyone suggests doing this -- what I don't want to do is create "mini" TIFF files on disk, and stitch them together to make one file. There should be no need to involve the file system in doing this, since LibTiff has the ability to change compression on the fly, in memory, for each page that is produced.

So if you have a small sample program that shows how to create, say a 2 page TIFF file, where the first page uses no compression, and the second page uses LZW (or something else), I would appreciate it.

dynarithmic avatar Dec 26 '18 23:12 dynarithmic