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 : Wednesday, July 25, 2007 10:39:47 PM(UTC)

M000761  
M000761

Groups: Registered
Posts: 14


Hi,

I am trying to import documents into a custom developed doc system created using leadtools 14.5. These documents are scanned TIF images created on a TOSHIBA scanner.

Using the following code:

dim mobjImg as RasterImage
dim objStream As FileStream

objStream = File.Open(mcstrFILE_PATH & mstrFileName, FileMode.Create)

RasterCodecs.Save(mobjImg, objStream, mobjImg.OriginalFormat, mobjImg.BitsPerPixel, 1, mobjImg.PageCount, 1, CodecsSavePageMode.Append)

The size of the original color tif is more than double the original size of the document even though I am trying to maintain the original file format (ie. using rasterimage.originalformat and rasterimage.bitsperpixel properties).

We are wanting to minimize the size of color tifs and this is a big problem. Can this be explained or fixed easily.


FYI the original format is reading as 'RasterImageFormat.TifJpeg411 {22}' when I break the code. I am not sure why {22} means or if this is contributing to the issue.

Thanks

Adam
 

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 : Thursday, July 26, 2007 11:09:19 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


I belive that {22} is just the enumberation value of the RasterImageFormat enumeration for TifJpeg411.

 

 

I believe you are confusing "lowest JPEG compression" with a low QFactor.  The lower the QFactor, the higher the quality is and larger the file.  The higher the QFactor (255 being the maximum) the lower the quality and smaller the file.  Try using a larger QFactor.

 
#3 Posted : Thursday, July 26, 2007 4:27:45 PM(UTC)

M000761  
M000761

Groups: Registered
Posts: 14


Can you show an example of how u would use that code.

It appears that Qfactor is only relevant to PDF compression. I am dealing with colour TIF documents... and see no reference to Qfactor property in the V14.5 API for .NET.

Please.
 
#4 Posted : Monday, July 30, 2007 4:44:39 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


Sorry if I confused you by the abbreviation, most interfaces use QFactor, but I forgot that the .NET interface uses QualityFactor for JPEG compressed images.  In essence they are the same thing, but one deals with the Advanced PDF compressor and the other is for everything else.  Below is a sample that shows how to use the QualityFactor property, I've also attached the sample images.


Dim img = codecs.Load("C:\Program Files\LEAD Technologies, Inc\LEADTOOLS 14.5\Images\IMAGE1.CMP")

codecs.Options.Jpeg.Save.QualityFactor = 2
codecs.Save(img, "d:\junk folder\qfactor_2.tif", RasterImageFormat.TifJpeg411, 24)

codecs.Options.Jpeg.Save.QualityFactor = 255
codecs.Save(img, "d:\junk folder\qfactor_255.tif", RasterImageFormat.TifJpeg411, 24)

File Attachment(s):
files.zip (186kb) downloaded 24 time(s).
 
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.297 seconds.