I used Silicon Graphics Image Format Library 1.3.1 to save images in Tiff
format with lzw compression. Now I want to update all our applications to
use GDI+ for that because it reduces the dependencies on additional dlls for
our software. Unfortunately the images are 50% larger when saved with GDI+
than they are with IFL. I already set the compression to LZW and the colour
depth to 24bit, but it brought nearly nothing. What else can I do? (Png is
not an option right now, because I need to stay compatible).
Thanks in advance,
Daniel Schlößer
I don't know if the options are available in GDI+, but there are
several ways to reduce the size of LZW TIFFs:
1) Store the color planes separately, rather than interleaved (tag
PLANARCONFIG [284] = PLANARCONFIG_SEPARATE [2]
2) Use horizontal differencing (tag PREDICTOR [317] = 2)
I use libtiff for handling TIFF files, and link it statically into my
EXE rather than build it as a dll.
http://www.remotesensing.org/libtiff
--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real, but please post replies on the newsgroup.
"Severian [MVP]" <seve...@chlamydia-is-not-a-flower.com> schrieb im
Newsbeitrag news:2fe471hpd4kk4f86g...@4ax.com...
"Severian [MVP]" <seve...@chlamydia-is-not-a-flower.com> schrieb im
Newsbeitrag news:2fe471hpd4kk4f86g...@4ax.com...
>It did not work!
>No matter when I try to set the properties PropertyTagPlanarConfig or
>PropertyTagPredictor of my bitmap to the values that I read from our
>existing files before calling Save(), the tiff files have always the same
>(much bigger) size. Are these tags supported for saving tiff images by GDI+
>at all?
I'm not personally familiar with GDI+, but if you e-mail me a file
(severian at severian dot org), I will save it with libtiff in various
ways to see what sizes I get.
Perhaps the TIFF encoder in GDI+ uses fixed values for
PropertyTagPlanarConfig and PropertyTagPredictor, when it compresses
the image. So those properties are effectively read-only, even though
you can actually change them?
Similarly, digital cameras often store the shutter speed as a property
within the output JPEG file. You can change the value of that property
(with GDI+), but this does not retrospectively change the shutter speed
the photo was taken with! So that property is effectively read-only,
even though you can actually change it.
Yes? No?
HTH,
TC
TC