GIF LZW Decompression

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
madankn79

GIF LZW Decompression

Post by madankn79 »

Hi All,

Am desperately looking for GIF Image De compressor. Can anyone please help me decompressing Giff images compressed with lzw.

* Will ImageMagick convert gif images with lzw conversion to uncompressed gif image.
* If ImageMagick cannot help me, then can anyone let me know any other tool/library which can do this.

Thanks In Advance.
Mady
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: GIF LZW Decompression

Post by fmw42 »

Post a link to an example GIF that you want to convert, so we can test it.

Also see non-IM tools at http://www.imagemagick.org/Usage/formats/#gif_non-im
Ragnar0k
Posts: 3
Joined: 2011-11-18T19:56:56-07:00
Authentication code: 8675308

Re: GIF LZW Decompression

Post by Ragnar0k »

Hello,
Just to bump this issue - I am in the same position as madankn79...
I am converting a tiff to a gif, the command would be
convert +compress <file.tif> <file.gif>
+compress however does not work, and neither does -compress None. gif files will always be produced with an LZW compression:

$ convert +compress ucid00182.tif test.gif
$ identify -verbose test.gif | grep -i compre
Compression: LZW

Please help...
I am using debian wheezy:
imagemagick 8:6.6.9.7-5+b1

Thank you in advance!!
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: GIF LZW Decompression

Post by glennrp »

If you just need the uncompressed image, why not convert it to PPM which is
a simple uncompressed format? If the output must be GIF but uncompressed
for some reason, there is libungif. Note that there is no longer any patent issue
about LZW which was the motivation for writing libungif about 1995.

See http://directory.fsf.org/wiki/Libungif
Ragnar0k
Posts: 3
Joined: 2011-11-18T19:56:56-07:00
Authentication code: 8675308

Re: GIF LZW Decompression

Post by Ragnar0k »

thank you for your feedback!
I really needed the uncompressed gif for some statistical work (and the work must be done on a gif only unfortunately). libungif tools don't seem to have any straight forward conversion between tiff and gif (tried tiff->rgb->gif but didn't work properly).
I guess I must write something myself (doh!)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: GIF LZW Decompression

Post by fmw42 »

Did you try putting +compress after the input image is read in. See http://www.imagemagick.org/Usage/basics/#why

convert ucid00182.tif +compress test.gif

or


convert ucid00182.tif -compress none test.gif
Ragnar0k
Posts: 3
Joined: 2011-11-18T19:56:56-07:00
Authentication code: 8675308

Re: GIF LZW Decompression

Post by Ragnar0k »

Same result unfortunately...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: GIF LZW Decompression

Post by fmw42 »

Ragnar0k wrote:Same result unfortunately...
Yes, I tried the same thing on some test images and got the same result -- cannot get rid of LZW

see non-im solutions at http://www.imagemagick.org/Usage/formats/#gif_non-im
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: GIF LZW Decompression

Post by magick »

ImageMagick supported uncompressed GIF but we removed support when the LZW compression patent expired world-wide.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: GIF LZW Decompression

Post by glennrp »

ImageMagick-5.5.7 is still available at SourceForge and I believe it supports uncompressed GIF.
Post Reply