Discussion:
How to open a TIFF image with LZW compression in C#
(too old to reply)
Gabriel Lozano-Moran
2007-08-27 14:32:01 UTC
Permalink
Hello

We are completely newbies when it comes to image processing. For one of our
projects the only feature involving working with TIFF images is that we need
to open and show on screen TIFF images that are compressed with LZW. I have
tried to google for an example but was unsuccessfull.

I am pretty confident that this could be done in 15 lines of code but we
would not know where to start.

Thanks in advance for any code samples.
Force Code
2007-08-27 19:00:39 UTC
Permalink
Post by Gabriel Lozano-Moran
Hello
We are completely newbies when it comes to image processing. For one of our
projects the only feature involving working with TIFF images is that we need
to open and show on screen TIFF images that are compressed with LZW. I have
tried to google for an example but was unsuccessfull.
I am pretty confident that this could be done in 15 lines of code but we
would not know where to start.
Thanks in advance for any code samples.
I've used the following product myself extensively. There are numerous
references to LZW in the documentation.

http://freeimage.sourceforge.net:
What is FreeImage?
FreeImage is an Open Source library project for developers who would like to
support popular graphics image formats like PNG, BMP, JPEG, TIFF and others
as needed by today's multimedia applications. FreeImage is easy to use,
fast, multithreading safe, compatible with all 32-bit versions of Windows,
and cross-platform (works both with Linux and Mac OS X).


begin 666 bullet_blue.jpg
M_]C_X `02D9)1@`!`@``9 !D``#_[ `11'5C:WD``0`$````1@``_^X`#D%D
M;V)E`&3 `````?_;`(0`! ,#`P,#! ,#! 8$`P0&!P4$! 4'" 8&!P8&" H(
M"0D)"0@*"@P,# P,"@P,#0T,#!$1$1$1%!04%!04%!04% $$!04(!P@/"@H/
M% X.#A04%!04%!04%!04%!04%!04%!04%!04%!04%!04%!04%!04%!04%!04
M%!04%!04%!04_\ `$0@`#0`*`P$1``(1`0,1`?_$`'P```,`````````````
M``````0'" $!````````````````````!A ```0$`@4-`````````````0(#
M! `1!08Q,V$2%!4U(5%QD:$B,D(34U0'%Q$``0(#!0@#`````````````0`"
M$0,$\$%181(A,:'10A,4!;$B,__:``P#`0`"$0,1`#\`*7^SKBM>_7I'3QRZ
MI-+>+$09)' A@,4P^G,YIS IA[T\0Y(;M]7)F2! 0<0-J"O]E-E5!#B7-!W*
MB/UNY/B-.%;***@GXXQOA;-*O*.'3J4MW2E90W+5]Y.JL%3VQ7:`;MF
MPH IK^03+@82],-J<U/;;I#80Q/)"ZH4_>=J+]4;@(?*=.H3W3\"EE%R^?,\
16C#3`^)PZK7)7]<_SX<U_]D`
`
end
Mark Salsbery [MVP]
2007-08-27 20:07:11 UTC
Permalink
The Bitmap class (in System.Drawing namespace) can load a TIFF in one line
of code.
I tested on an LZW-compressed TIFF file and it worked fine.

A couple lines of code will draw the Bitmap using a Graphics object.

I'd show an example but I don't know C# :)

Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
Post by Gabriel Lozano-Moran
Hello
We are completely newbies when it comes to image processing. For one of our
projects the only feature involving working with TIFF images is that we need
to open and show on screen TIFF images that are compressed with LZW. I have
tried to google for an example but was unsuccessfull.
I am pretty confident that this could be done in 15 lines of code but we
would not know where to start.
Thanks in advance for any code samples.
Rene Pilon
2007-10-22 04:43:15 UTC
Permalink
If it's a multipage TIFF - you want to make sure to display the proper frame
/ image.

Refer to the Image.GetFrameCount( ) and Image.SelectActiveFrame( ) methods.

Rene Pilon

Loading...