LEADTOOLS Support
Imaging
Imaging SDK Questions
Creating Multipage TIFF image - FILE size is too large
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, July 18, 2005 8:13:51 PM(UTC)
Groups: Registered
Posts: 2
Hi,
We are using Lead Tools Pro v 13 APIs in VC++. We have muliple images in various format. Images are Black and White and Gray Scale format. We want to convert it into Multiplage Tiff. I am using following function:
bool CMultiPageFile::SaveAsTiffImage(void* dump, int nBufferSize, const char* type)
{
L_INT nRet; /* Return value */
BITMAPHANDLE pBitmap;
nRet = L_LoadBitmapMemory((char *)dump, &pBitmap, 0, ORDER_BGRORGRAY, nBufferSize, NULL, NULL);
if(nRet < 1)
{
_LOG( _FNL_, LGMessageLog::logError, "MultiPageFile::Error: %d", nRet);
LogLeadToolError(nRet);
}
nRet = L_SaveFile(TEXT("TempMultiPageFile.TIF"),
&pBitmap,
FILE_TIF_PACKBITS, 24, MC,
SAVEFILE_MULTIPAGE,
NULL,
NULL,
NULL);
if (nRet < 1)
{
_LOG( _FNL_, LGMessageLog::logError, "MultiPageFile::Error: %d", nRet);
LogLeadToolError(nRet);
}
return true;
}
The image saved on harddisk has size 334 KB which is large enough. I also tried to use FILE_TIF_J2K but L_SaveFile() is returning me error -541. Can you please tell me best method of compression? Will FILE_TIF_J2K give me best results? How can I get licence key to use FILE_TIF_J2K format?
Ramchandra
#2
Posted
:
Tuesday, July 19, 2005 10:25:17 PM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The reason your saved files are large is that you are saving as 24
bits. For black and white images, save as 1 bit with CCITT Group4
comression. For grayscale, save as 8 bits with JPEG compression
(FILE_JTIF). J2K gives even better compression than JPEG, but it
requires purchasing the JPEG2000 plug-in use.
Bashar Abdulqaiyume
LEAD Technologies, Inc.
#3
Posted
:
Thursday, July 21, 2005 7:59:23 PM(UTC)
Groups: Registered
Posts: 2
Thanks, I tried using FILE_JTIF the size is now reduced to 200 KB. I have two images one is back & white and other is gray scale. Can I create a TIFF image with first page as CCITT Group4 and other page as FILE_JTIF?
#4
Posted
:
Monday, July 25, 2005 11:26:20 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Yes you can do that. Each TIFF page has its own compression and bitdepth.
Bashar Abdulqaiyume
LEAD Technologies, Inc.
LEADTOOLS Support
Imaging
Imaging SDK Questions
Creating Multipage TIFF image - FILE size is too large
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.