By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,401 Members | 820 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,401 IT Pros & Developers. It's quick & easy.

TIFF compression & transfer

P: n/a
Hello, we have an app that scans documents into TIFF format and we
need to transfer them over the internet. If anyone knows of a SDK we
can use that can compress TIFFs on the fly or even if it can compress
them so they take up less space on the server, would be appreciated.

Actually any info on handling tiff files programatically would be
appreciated as I know very little about tiffs.

TIA

G
Nov 18 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
GiJeet,

Well, you would want to look at the classes in the System.Drawing
namespace for classes to work with manipulating the TIFF (specifically, the
Bitmap class).

To compress the image for storage, you can look at the classes in the
System.IO.Compression namespace.

- Nick

"GiJeet" <gi****@yahoo.comwrote in message
news:5c**********************************@f37g2000 pri.googlegroups.com...
Hello, we have an app that scans documents into TIFF format and we
need to transfer them over the internet. If anyone knows of a SDK we
can use that can compress TIFFs on the fly or even if it can compress
them so they take up less space on the server, would be appreciated.

Actually any info on handling tiff files programatically would be
appreciated as I know very little about tiffs.

TIA

G
Nov 18 '08 #2

P: n/a
On Tue, 18 Nov 2008 06:02:28 -0800, GiJeet <gi****@yahoo.comwrote:
Hello, we have an app that scans documents into TIFF format and we
need to transfer them over the internet. If anyone knows of a SDK we
can use that can compress TIFFs on the fly or even if it can compress
them so they take up less space on the server, would be appreciated.

Actually any info on handling tiff files programatically would be
appreciated as I know very little about tiffs.
What kind of compression are you looking for?

You can use the GzipStream class to compress arbitrary data. But,
depending on your original TIFF, it may not compress much, if at all.
That is, if it's already in a compressed form (TIFF supports a variety of
compression methods), additional compression may not help, and even if
it's not, GzipStream isn't optimized for image compression.

You can use the classes in the System.Drawing.Imaging namespace to do
things like read the TIFF in as an Image instance and then save that Image
instance back to a file or stream in a different format. If the format
has to remain as a TIFF, your ability to compress it may be limited or
non-existent, unless it's permissible to actually change the image
itself. In that case, you could "compress" the image simply by reducing
its resolution, by creating a smaller Bitmap instance and copying the
original to the smaller one before saving it from the smaller one (halving
each dimension will result in a 4x reduction in size simply from that
process alone).

If the format doesn't need to remain as TIFF, then you also can try using
PNG (lossless) or JPEG (lossy) output. Unfortunately, .NET doesn't have
much elaborate support for PNG and so you won't necessarily get the
optimal compression out of it, but at least it will do some compression.
With JPEG you can control the compression/quality setting, which as long
as it's permissible to modify the image data in the process of compression
can produce very good compression results.

But first, you need to figure out what it means to "compress" the data and
what requirements you have with respect to preserving the original image
data.

Pete
Nov 18 '08 #3

P: n/a
Are you using any of the headers in a TIFF file? Is it nonstandard in
any way? If it's just an image convert it to JPG if it is a photo or
PNG if it is not. TIFF is old, lame, and on its way out as far as a
generic image format is concerned. The GIS folk do a lit with custom
TIFF layers. If that's not you, just convert it and be done. I can't
see any good reason to use a gzip compression on a TIFF.
Nov 19 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.