Compression / fax like quality problem!

Example requests (Development Tools) including source code requests

Moderator: Technical Support Team

Compression / fax like quality problem!

Postby eDayNova » Mon Jul 24, 2006 5:28 pm

Hi i'm using the twain ocx and the tiff ocx from the tiff sdk. I'm trying to figure out how to scan a black and white document and then save it in a tiff file with the same filesize and quality as if it was a fax ( about 100kb and best quality possible) but i'm having problems and dont know what functions to call etc.

the best i could acheive is 290kb with the tiff format and jpeg compression. But i'm scanning at 200 dpi and thats way too much for a fax. and the output image is 1700x2178 but i dont know how to change these two things.

Any help?
eDayNova
 
Posts: 4
Joined: Sun Jul 23, 2006 9:22 am

Postby TechnicalSupportTeam » Tue Aug 22, 2006 1:21 pm

Fax resolution would be 204x192 for fine fax resolution. You can take a look at our TWAIN sample source code for information on setting resolution.
TechnicalSupportTeam
 
Posts: 1002
Joined: Sat Mar 20, 2004 11:50 am

Fixed the problem

Postby eDayNova » Thu Aug 24, 2006 4:13 pm

Hi, i've fixed all my problems contacting the Black Ice support directly. It's actually been like 2-3 weeks now. I needed to create a multipage tiff out of many single page and multipage tiffs. Then, compress it as much as possible without quality loss. This code takes all the tiffs in a directory and adds them to a single multipage tiff file ready to be compressed with zip compression (you could compress the multipage tiff by changing the 201 parameter to something like 204 or 209, but the following zip compression will be less effective). Here's what I did:

VB.NET 2005 Code:

[code]

Dim FolderContainingTIFFs As String = "C:\TIFF" ' Directory containing TIFFs
Dim OutputTIFFfile As String = "C:\Output.tif" ' Output TIFF file
Dim hDIB As Integer 'DIB that will contain the page loaded from the tiff file
Dim hDIB2 As Integer 'DIB that will contain Halftoned image
Dim PageCount As Integer 'Number of pages in tiff file
Dim CurrentPage As Short 'Current page in tiff file
Try 'Error Handling
Dim pattern As String = "*.tif" ' Type of files to loop through
Dim dir_info As New System.IO.DirectoryInfo(FolderContainingTIFFs) 'Directory to look into
Dim file_infos() As System.IO.FileInfo 'Will contain info about the files found
file_infos = dir_info.GetFiles(pattern) 'Get all the files matching the pattern
For Each file_info As System.IO.FileInfo In file_infos 'Loop through files
PageCount = BIDIB.GetNumberOfImagesInFile(file_info.FullName, 9998) 'Get nuber of pages in tiff file
If PageCount = 9998 Then MsgBox("Error? Pagecount returned 9998")
For CurrentPage = 0 To PageCount - 1 'Loop through pages in TIFF file
hDIB = BIDIB.LoadImageIntoDIB(file_info.FullName, CurrentPage) 'Load the page into DIB
hDIB2 = BIDIB.Halftone(hDIB, 1, -20) 'Halftone the DIB
If CurrentPage = PageCount - 1 Then 'Last page of tiff file
Kill(file_info.FullName) 'Delete the tiff
End If
If hDIB2 <> 0 Then ' Halftone was OK
BITiff.SaveDIBInTiffFormat _
(OutputTIFFfile, hDIB2, 201, False) 'Change 201 to 204 or 209 for compression
Else ' Halftone failed, use DIB that wasen't halftoned
BITiff.SaveDIBInTiffFormat(OutputTIFFfile, hDIB, 201, False)'Change 201 to 204 or 209 for compression
End If
BIDIB.DropDIB(hDIB) 'Release DIB
BIDIB.DropDIB(hDIB2) 'Release DIB
Next CurrentPage
Next file_info
Catch err As System.Exception
MsgBox("Error" & err.Message)
End Try

[/code]

I would then use other code to zip this very big file into something like 12kb/page with excellent quality.

eDayNova
eDayNova
 
Posts: 4
Joined: Sun Jul 23, 2006 9:22 am

Re: Compression / fax like quality problem!

Postby KGAMMAA » Sat Oct 30, 2010 2:52 am

eDayNova wrote:Hi i'm using the twain ocx and the tiff ocx from the tiff sdk. I'm trying to figure out how to scan a black and white document and then save it in a tiff file with the same filesize and quality as if it was a fax ( about 100kb and best quality possible) but i'm having problems and dont know what functions to call etc.

the best i could acheive is 290kb with the tiff format and jpeg compression. But i'm scanning at 200 dpi and thats way too much for a fax. and the output image is 1700x2178 but i dont know how to change these two things.

Any help?


I'm use vb6 ..
I have same problem .. How you fixed the problem ?
KGAMMAA
 
Posts: 2
Joined: Wed Oct 20, 2010 12:47 am

Re: Compression / fax like quality problem!

Postby KGAMMAA » Sat Oct 30, 2010 4:11 am

Helo
I've got a problem in receiving the fax comes half of A4 paper and required to receive the entire fax.
For the technical support they say that this fax standard mode, but no Icolo What is the practical solution to change the standard mode fax
you can help on this topic!?
KGAMMAA
 
Posts: 2
Joined: Wed Oct 20, 2010 12:47 am

Re: Compression / fax like quality problem!

Postby blakebaker008 » Fri May 05, 2017 8:01 am

I've got a tangle in receiving the fax comes 1/2 A4 paper and needed to receive the whole fax.
For the technical support they are saying that this fax customary mode, however no Icolo what's the sensible answer to vary the quality mode fax
blakebaker008
 
Posts: 9
Joined: Wed May 03, 2017 7:27 am


Return to Example requests



Who is online

Users browsing this forum: No registered users and 1 guest

cron