Board index » delphi » Best image type for B&W Documents

Best image type for B&W Documents


2004-02-17 10:50:05 AM
delphi115
Can anyone tell me what is the best image type for B&W multi-page documents?
For my needs, I'd say that size is more important than speed and that
the quality of the documents is very high (probably lossless?).
I have used Tiff many years ago (about 7!) and I was just wondering if there
was a newer/better technology...
Did MNG ever "happen"... it was the "up and coming technology" many years
ago!!!(yea, I have heard that many times too!!!<grin>)
Also, can you point me to a good library to use the above selected file
format with Delphi????
Thanks much!!!!
-- Raymond
Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________
 
 

Re:Best image type for B&W Documents

Raymond,
Is PDF out of the question for you?
I use it (integrated into my App via the OCX) to manage multi-age documents
in a multimedia CDROM I have produced. It has the nice advantage that my
users can "zoom" the pages to make them more readable (wide range of age
groups and vision quality). There are a number of Delphi-friendly PDF
components about in various Newsgroups, Websites etc. too.
BTW, in most cases the size of the files (where they are pure text, and
"clean") is much better than TIFF or other "lossless" format. If the
documents have "noise" (are "dirty" or littered with graphical artefacts)
the files do become quite large.
Cheers, Paul
"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
Can anyone tell me what is the best image type for B&W multi-page
documents?

For my needs, I'd say that size is more important than speed and that
the quality of the documents is very high (probably lossless?).

I have used Tiff many years ago (about 7!) and I was just wondering if
there
was a newer/better technology...

Did MNG ever "happen"... it was the "up and coming technology" many years
ago!!!(yea, I have heard that many times too!!!<grin>)

Also, can you point me to a good library to use the above selected file
format with Delphi????

Thanks much!!!!
-- Raymond

Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________


 

Re:Best image type for B&W Documents

I would also advice PDF.
The B/W pages can be stored in PDF as CITTFAX G4 (Group4 fax) and even in
PDF1.5 as JBIG.
This means efficient compression and PDF also ensures 1) multipage 2) good
printing capability and 3) everyone can work with it (market leader I guess)
You can download the PDF specification and write your own PDF files from
scratch, or use any of the PDF printer drivers, PDF Delphi components, or an
Adobe product.
You can add images losslessly to PDF, but you must ensure that they are not
stored as JPG or that they are resampled by the driver.
Kind regards,
Nils Haeck
www.simdesign.nl
"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
Can anyone tell me what is the best image type for B&W multi-page
documents?

For my needs, I'd say that size is more important than speed and that
the quality of the documents is very high (probably lossless?).

I have used Tiff many years ago (about 7!) and I was just wondering if
there
was a newer/better technology...

Did MNG ever "happen"... it was the "up and coming technology" many years
ago!!!(yea, I have heard that many times too!!!<grin>)

Also, can you point me to a good library to use the above selected file
format with Delphi????

Thanks much!!!!
-- Raymond

Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________


 

Re:Best image type for B&W Documents

Thanks Nils and Paul!!!
PDF sounds very interesting!!!
Quote
The B/W pages can be stored in PDF as CITTFAX G4 (Group4 fax) and even in
PDF1.5 as JBIG.
Hmmm, how would you suggest adding the pages to a PDF? I am not sure but I
believe the network printers have an option to actually "print to TIFF"
built in... so is there a way to convert a TIFF to a PDF natively in
Delphi...
I hate to use any OCX's or DLL's that I do not have control of... I hate DLL
HELL!<g>I was burned way too many times using the DLL's and OCX's way back
when Win32 started to include Kodak's Imaging components!
Thanks,
-- Raymond
Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________
 

Re:Best image type for B&W Documents

I am writing native PDF code that can handle this, but it is not ready for
release yet.
But there are some PDF components around (Delphi, with source), which can
perhaps do this. One is called "WPTools" and another "PDF-in-the-box". I
would advise to test them carefully, and definitely verify whether they're
lossless or not.
You can also read the spec for PDF (although it is bulky at something like
1500 pages) and just implement what you need. You would need the following:
1) Root dictionary and XREF table
2) Pages tree
3) A page dictionary for each page
4) A page stream for each page, compression optional (flate) but not really
neccesary because there's almost nothing on the page, just the image.
5) An XObject image in each page, with the b/w image compressed as CITTFAX
G4
You're still looking at a few weeks of work if you want to do it all
yourself.. So a component is probably the best solution.
Kind regards,
Nils Haeck
"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
Thanks Nils and Paul!!!

PDF sounds very interesting!!!

>The B/W pages can be stored in PDF as CITTFAX G4 (Group4 fax) and even
in
>PDF1.5 as JBIG.

Hmmm, how would you suggest adding the pages to a PDF? I am not sure but I
believe the network printers have an option to actually "print to TIFF"
built in... so is there a way to convert a TIFF to a PDF natively in
Delphi...

I hate to use any OCX's or DLL's that I do not have control of... I hate
DLL
HELL!<g>I was burned way too many times using the DLL's and OCX's way
back
when Win32 started to include Kodak's Imaging components!

Thanks,
-- Raymond
Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________


 

Re:Best image type for B&W Documents

Quote
I am writing native PDF code that can handle this, but it is not ready for
release yet.
Hi Nils,
I am not in a hurry... I am in the middle of a large database migration
project right now...
I would like to hear more about your native PDF code... I am still at the
same email address so please send me some info off-line. (if you have purged
your address book, just remove the NS from my newsgroup return address)
Remember... you still owe me a beer...<G>
Thanks,
-- Raymond
Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________
 

Re:Best image type for B&W Documents

Hi Raymond,
Your name sounded familiar indeed :) I still have your email address from
the XML/ABC conversations, will send you a demo of what we have so far to
that one.
Kind regards,
Nils
"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
>I am writing native PDF code that can handle this, but it is not ready
for
>release yet.

Hi Nils,

I am not in a hurry... I am in the middle of a large database migration
project right now...

I would like to hear more about your native PDF code... I am still at the
same email address so please send me some info off-line. (if you have
purged
your address book, just remove the NS from my newsgroup return address)

Remember... you still owe me a beer...<G>

Thanks,
-- Raymond

Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________


 

Re:Best image type for B&W Documents

"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
I hate to use any OCX's or DLL's that I do not have control of... I hate
DLL
HELL!<g>I was burned way too many times using the DLL's and OCX's way
back
when Win32 started to include Kodak's Imaging components!
I share your dislike for overkill. Eliminating all document-ish formats,
enumerating only pure raster formats, for BW images, I see these options:
- PNG
- TIFF with compression G3
- TIFF with compression G4
- TIFF with compression LZW
- TIFF with compression Deflate
- JBIG
For PNG, your best option probably is LibPng. Can be compiled with the
Builder to .obj files and included in a Delphi project without the usage of
DLL's, just like Borland included LibJpeg for use in TJpegImage, but this is
a bit tricky, and unless you're eager to invest some time and research, a
DLL may be easier. For TIFF, your best option is probably LibTiff. Both the
formats PNG and TIFF as well as the libraries LibPng and LibTiff are free to
use in both free and commercial products. G3 and G4 are free as a bird, too
(the difference being that error-recovery is better with G3, whilst
compression ratio is way better with G4). LZW may be free again, or may have
been free all the time contrary to what some want us to believe but are
unable to enforce, but there is at least doubt about this subject. JBIG and
the newer JB2 are more encombered by patents and such, and LibJbig is
rendered useless through a marxist licence agreement.
Joris Van Damme
XXXX@XXXXX.COM
www.awaresystems.be
 

Re:Best image type for B&W Documents

Joris,
Thanks for the info!!!
Quote
- TIFF with compression G3
- TIFF with compression G4
- TIFF with compression LZW
- TIFF with compression Deflate
For TIFF, your best option is probably LibTiff. Both the
formats PNG and TIFF as well as the libraries LibPng and LibTiff are free
to
use in both free and commercial products. G3 and G4 are free as a bird,
too
(the difference being that error-recovery is better with G3, whilst
compression ratio is way better with G4).
Do you have any suggestions for viewing the Tiff files?
Thanks,
-- Raymond
Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________
 

Re:Best image type for B&W Documents

"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
Do you have any suggestions for viewing the Tiff files?
What exactly do you mean?
I can recommend LibTiff for encoding as well as decoding TIFF.
I know there's probably a few components out there that aim at 'viewing a
specific graphic file format', but that is not very VCL-style at the very
least. The VCL way to do these things is have a graphic type like
TGraphicTiff or something, inheriting from TGraphic, implement both internal
raster managment and drawing, and interfacing with LibTiff for encoding and
decoding. Next, there's a TImage component, that should be able to work with
any TGraphic in order to render it and present it inside a UI. So a true
VCL-ish TIFF viewing solution certainly envolves a TGraphicTiff, and
possibly an extended TImage more capable of rendering and showing any
TGraphic, but certainly not any kind of TTiffViewer component or
something...
This being said, no, I don't know of any viewing solution as in 'ready-made
third-party-component', TGraphicTiff type or TTiffViewer type. But I don't
use any such third-party stuff, so I wouldn't know, would I. There probably
is, as even such a TTiffViewer solution would probably serve you just right
anyway, but you will need someone else to point you to it. I'd be happy to
point you to my own solutions, but they're not yet finished and won't be
shipped for some time.
Joris Van Damme
XXXX@XXXXX.COM
www.awaresystems.be
 

Re:Best image type for B&W Documents

Quote
What exactly do you mean?
Well, I was hoping for a component/solution that would allow me to view the
pages in the Tiff file...
I would like to be able to see the pages and navigate the Tiff file pages if
possible... zoom, pan, etc...
Thanks,
-- Raymond
Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________
 

Re:Best image type for B&W Documents

"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
>What exactly do you mean?

Well, I was hoping for a component/solution that would allow me to view
the
pages in the Tiff file...

I would like to be able to see the pages and navigate the Tiff file pages
if
possible... zoom, pan, etc...
Yes, well, my answer remains:
- LibTiff will do the decoding part for you perfectly fine.
- Any viewing solution that truely respects the spirit of the VCL will exist
of a TGraphicTiff and possibly an extended TImage component, but not a
single component that allows you to specifically view a TIFF.
- Nevertheless it is possible that a direct TIFF viewing solution without
TGraphicTiff part suits you just fine.
- you will need someone else to point you to a good viewing solution, I have
plenty of experience in missing deadlines, but not in using third party
stuff. Sorry.
- My own solution includes a TGraphicTiff, multipage, with 'current page'
notion and thus page navigation support, plus thumbnail viewer, plus
extended very performing TImage-like component, etc... but is not at all
finished yet. If you want to be kept informed of any progress, drop us a
line at XXXX@XXXXX.COM.
Joris Van Damme
XXXX@XXXXX.COM
www.awaresystems.be
 

Re:Best image type for B&W Documents

Hi Raymond,
I am currently creating a TIF graphic loader based on Libtiff and it works
for single-image TIFFs already. Can you perhaps send me a multipage TIFF
image (one that is representative of TIFFs you usually work with) so that I
can test here, and get the multi-page feature to work?.
In exchange for your help I can provide you with a free copy of this library
(which is also able to load and save BMP, GIF, JPG, JP2 and PNG).
"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
>What exactly do you mean?

Well, I was hoping for a component/solution that would allow me to view
the
pages in the Tiff file...

I would like to be able to see the pages and navigate the Tiff file pages
if
possible... zoom, pan, etc...

Thanks,
-- Raymond
Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________


 

Re:Best image type for B&W Documents

Hi Joris,
Joris wrote in <XXXX@XXXXX.COM>:
Quote
For PNG, your best option probably is LibPng.
For PNG with Delphi I recommend TPngImage from Gustavo Daud.
A list with freeware PNG libraries for Delphi, you can find on my
homepage: delphi.pjh2.de/articles/graphic/png.php
Bye Peter.
--
JEDI+ API, the active JEDI Header Conversions Project:
jediplus.pjh2.de
 

Re:Best image type for B&W Documents

You may also be interested in Envision Image Library. It has full support
for may graphic types including full support for multi-page tiff's. Go to:
www.intervalsoftware.com/
It is not free, but it is very cheap. It will handle annotation, and can
also be used in conjunction with an ocr engine. Many nice features, i have
purchased it myself and found it most valuable.
Hope this helps,
Dave
"Raymond J. Schappe" <XXXX@XXXXX.COM>writes
Quote
>What exactly do you mean?

Well, I was hoping for a component/solution that would allow me to view
the
pages in the Tiff file...

I would like to be able to see the pages and navigate the Tiff file pages
if
possible... zoom, pan, etc...

Thanks,
-- Raymond
Raymond J. Schappe
Isthmus Technology Solutions, LLC
______________________________________