Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tiff images with GDI+ significantly larger than with other image lib

53 views
Skip to first unread message

Daniel Schlößer

unread,
Apr 29, 2005, 9:11:25 AM4/29/05
to
Hi,

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


Severian [MVP]

unread,
Apr 29, 2005, 9:53:56 AM4/29/05
to

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.

Daniel Schlößer

unread,
Apr 29, 2005, 4:11:30 PM4/29/05
to
Thanks, that was it! I looked the gdi+ documentation and it seems I have
access to these tags! Thank you, I will try it tomorrow.
;-)

"Severian [MVP]" <seve...@chlamydia-is-not-a-flower.com> schrieb im
Newsbeitrag news:2fe471hpd4kk4f86g...@4ax.com...

Daniel Schlößer

unread,
Apr 30, 2005, 8:12:35 AM4/30/05
to
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?

"Severian [MVP]" <seve...@chlamydia-is-not-a-flower.com> schrieb im
Newsbeitrag news:2fe471hpd4kk4f86g...@4ax.com...

Severian [MVP]

unread,
Apr 30, 2005, 10:06:55 PM4/30/05
to
On Sat, 30 Apr 2005 14:12:35 +0200, "Daniel Schlößer"
<schl...@eplusv.de_NOJUNK> wrote:

>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.

TC

unread,
May 1, 2005, 3:30:26 AM5/1/05
to
I'm just guessing, but ...

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

unread,
May 1, 2005, 4:26:03 AM5/1/05
to
IOW, it sounds like those tags are /not/ supported when saving TIFF
files with GDI+ ...

TC

0 new messages