Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: Compress a multipage tiff
Started by wilxom at 01-29-2008 2:11. Topic has 7 replies.

Print Search « Previous Thread Next Thread »
  01-29-2008, 2:11
wilxom is not online. Last active: 3/8/2008 1:07:07 AM wilxom

Top 150 Posts
Joined on 01-09-2008
Posts 15
Compress a multipage tiff
Reply Quote
Hi,

I'm using LeadTools 14.0 COM to develop a small program which insert multiple images (JPG & TIFF) into a multipage tiff file. For JPG images, I will need to use a compression named "JPEG Original Tiff 6.0 spec" while for TIFF images will need "Group 4 Fax (aka CCITT Fax4). In this case, what is the available compression type available for me to achieve this.
Thanks in advanced.

Regards,
Wilson

   Report 
  01-29-2008, 5:31
Maen Hasan is not online. Last active: 8/14/2008 8:56:49 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,715
Re: Compress a multipage tiff
Reply Quote
Hello,

To save TIF Files with JPEG compression, try to use the FILE_TIF_JPEG constant with the Save method.
To save TIF Files compressed using CCITT group4, try to use FILE_CCITT_GROUP4 constant.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
  01-30-2008, 8:14
wilxom is not online. Last active: 3/8/2008 1:07:07 AM wilxom

Top 150 Posts
Joined on 01-09-2008
Posts 15
Re: Compress a multipage tiff
Reply Quote
Hi,

Thanks for the reply. By the way, i manage to solved the TIFF compression problem. But i still having problem with the JPEG compression as an error prompted out "Invalid QFactor specified". Below was my code:

RasterIO.Save rasterImage, strDir & strName, FILE_TIF_JPEG, 8, nCount, SAVE_APPEND

I'm using 8 bit (Greyscale) and above code for 2nd image added to the multipage tiff. Please assist. Thanks.

Regards,
Wilson
   Report 
  01-31-2008, 7:23
Maen Hasan is not online. Last active: 8/14/2008 8:56:49 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,715
Re: Compress a multipage tiff
Reply Quote
Hello,

The problem might be related to the value of the Quality Factor that you use when saving the file. Try to save the file as follows:

RasterIO.Save rasterImage, strDir & strName, FILE_TIF_JPEG, 8, 2, SAVE_APPEND

Please let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
  01-31-2008, 8:19
wilxom is not online. Last active: 3/8/2008 1:07:07 AM wilxom

Top 150 Posts
Joined on 01-09-2008
Posts 15
Re: Compress a multipage tiff
Reply Quote
Hi,

I manage to compress the JPEG file successfully. By the way, i found that the compression available was new compression for JPEG. I had tried below compression method:

i. FILE_TIF_JPEG
ii. FILE_TIF_JPEG_411
iii. FILE_TIF_JPEG_422
iv. FILE_TIF_J2K

I need an old JPEG compression to compress my images to the size below 50 kb. The compression needed was "JPEG original TIFF 6.0 spec". Thanks for your assistance.

Regards,
Wilson
   Report 
  01-31-2008, 8:29
Maen Hasan is not online. Last active: 8/14/2008 8:56:49 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,715
Re: Compress a multipage tiff
Reply Quote
Hello,

To save old JTIF files, try to set the RasterIO.SaveOldJTIF property to True before saving the file.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
  01-31-2008, 9:02
wilxom is not online. Last active: 3/8/2008 1:07:07 AM wilxom

Top 150 Posts
Joined on 01-09-2008
Posts 15
Re: Compress a multipage tiff
Reply Quote
Hi,

I try the below 2 options but both in return with invalid properties used.

Option 1:
RasterIO.SaveOldJTIF = True
RasterIO.SaveOldJTIF rasterImage, strDir & strName, FILE_TIF_JPEG, 8, 1, SAVE_OVERWRITE

Option 2:
RasterIO.SaveOldJTIF = True
RasterIO.Save rasterImage, strDir & strName, FILE_TIF_JPEG, 8, 1, SAVE_OVERWRITE

Just for enquiry, am i using the wrong command. Please assist. Thanks.

Regards,
Wilson

   Report 
  01-31-2008, 12:12
Maen Hasan is not online. Last active: 8/14/2008 8:56:49 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,715
Re: Compress a multipage tiff
Reply Quote
Wilson,

You should use the Save method, but you are passing a wrong value in Quality Factor parameter. You should not pass 1, but a value between 2 and 255. Please read the help topic "Compression Quality Factors" in our Main Raster COM help file.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » Image Compressi... » Re: Compress a multipage tiff

Powered by Community Server, by Telligent Systems