Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, July 18, 2005 8:13:51 PM(UTC)
Ramchandra

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 

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, July 19, 2005 10:25:17 PM(UTC)

Bashar  
Guest

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)
Ramchandra

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)

Bashar  
Guest

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.
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.099 seconds.