comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » GIF compression support in ImageMagick - Re-Post
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
GIF compression support in ImageMagick - Re-Post [message #41638] Wed, 03 November 2004 22:26 Go to next message
Lince.Lawrence is currently offline  Lince.Lawrence
Messages: 4
Registered: November 2004
Junior Member
friends

As in this message. How can I enable LZW in ImageMagick? Where should
I alter the default option as advocated in the Quoted mail
"--enable-lzw (configuration switch)"

Currrently I am using ImageMagick to convert EPS to GIF by punchin in
the following command sequence in the command line:

convert -antialias -transparent white -colors 16 -compress LZW
eqn10.eps eqn10.gif

The output should come around 4K, whiile using the above command I get
a comparitively huge file of 20K. So I think the command "-compress
LZW" is not executed correctly (may be due to the disabled LZW option)

Kindly pour-in your valuable comments.

Thanks,
Lince M Lawrence

================================ Quote =============================

Yes, this is related (marginally) to IDL.

In the discussion on the lack of GIF support in IDL 5.4 a month or two
ago,
I said that ImageMagick (http://www.imagemagick.org/) was a good tool
for
creating GIFs. Although I have used ImageMagick for years I don't
create
GIFs very often. And I failed to notice that some time recently the
following comment has appeared in the README:

***

--enable-lzw (configuration switch)

Unisys reportedly claims a patent on the algorithm supporting LZW
compression (e.g. used by GIF and TIFF). To avoid possibly infringing
on
this patent, support for LZW is disabled by default. With LZW support,
GIF
files written by ImageMagick will be much larger than expected

***

This explains the enormous increase in size when I converted some
files from
PNG to GIF the other day!

So ImageMagick is not a good tool for creating GIFs (unless you go to
some
trouble to enable LZW compression) and IDL is not the only
organisation
abandoning GIF because of patent issues.

All the more reason to BURN ALL GIFS, I say.

BTW, ImageMagick can still *read* compressed GIFs.

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research

================================ Quote =============================
Re: GIF compression support in ImageMagick - Re-Post [message #41689 is a reply to message #41638] Tue, 09 November 2004 12:42 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Lince M Lawrence wrote:
>
> I will explain...
>
> We do "convert -antialias -transparent white -trim -depth 16 -colors
> 16 $1 $2" and we get... (in Image Magic)
> ==============================================
> Image: si1.gif
> Format: GIF (CompuServe graphics interchange format)
> Geometry: 7x7
> Class: PseudoClass
> Type: grayscale with transparency
> Depth: 8 bits-per-pixel component
> Colors: 16
> [snip]
>
> But.. we want...
> ==============================================
> Image: si1finished.gif
> Format: GIF (CompuServe graphics interchange format)
> Geometry: 9x7
> Class: PseudoClass
> Type: palette with transparency
> Depth: 8 bits-per-pixel component
> Colors: 16
> 0: ( 0, 0, 0) opaque
> 1: ( 8224, 8224, 8224) #202020
> 2: (24415,24415,24415) #5f5f5f
> 3: (42148,42148,42148) #a4a4a4
> 4: (53970,53970,53970) #d2d2d2
> 5: (59110,59110,59110) #e6e6e6
> 6: (63479,63479,63479) grey97
> 7: (65535,65535,65535) white
> 8: (32896,32896,32896) #808080
> 9: (65535, 0, 0) red
> 10: ( 0,65535, 0) #00ff00
> 11: (65535,65535, 0) yellow
> 12: ( 0, 0,65535) blue
> 13: (65535, 0,65535) #ff00ff
> 14: ( 0,65535,65535) cyan
> 15: (65535,65535,65535) white
> [snip]
>
> This result is obtained by another batch process in GraphicConverter
> after the comand-line batch in Magic. Will I get this in a single
> step? What change should I make in the command.

I'm sure you *can* get the image parameters you want in ImageMagick. I'm
no IM expert, however, so I'm not sure how. You may be better off asking
this question on the ImageMagick "Users" mailing list. See

mailto:magick-users@imagemagick.org
http://www.imagemagick.org/www/magick-list.html

One thing that occurs to me: why did you set "-depth 16" above? This
appears to have persuaded IM to create a gray-scale image.

I just went through the exercise of saving an EPS file (test.eps) from
IDL then converting it to GIF format with

convert -verbose -antialias -transparent white -colors 16 test.eps
test16.gif

(For some reason I need the -verbose option here. Without it, IM opens
the Ghostscript interpreter but does not run it. Odd.)

This creates a reasonable-looking, if coarse, 16-colour GIF--see outpt
below my signature from

identify -verbose test16.gif

Or do you want a specific set of 16 colours? I'm sure this can be done
too, but I don't know how.


--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)

Image: test16.gif
Format: GIF (CompuServe graphics interchange format)
Geometry: 387x344
Class: PseudoClass
Colorspace: RGB
Type: PaletteMatte
Depth: 8 bits
Endianess: Undefined
Channel depth:
Red: 8-bits
Green: 8-bits
Blue: 8-bits
Opacity: 1-bits
Channel statistics:
Red:
Min: 3
Max: 255
Mean: 160.822
Standard deviation: 110.361
Green:
Min: 4
Max: 255
Mean: 179.791
Standard deviation: 94.0356
Blue:
Min: 3
Max: 255
Mean: 175.115
Standard deviation: 100.59
Opacity:
Min: 0
Max: 255
Mean: 130.553
Standard deviation: 127.464
Colors: 16
0: ( 44, 15, 50, 0) #2C0F3200
1: ( 4, 4,162, 0) #0404A200
2: ( 4, 23,223, 0) #0417DF00
3: ( 3, 97,162, 0) #0361A200
4: ( 17, 72,197, 0) #1148C500
5: ( 3,161,100, 0) #03A16400
6: ( 18,227, 21, 0) #12E31500
7: ( 99,164, 3, 0) #63A40300
8: ( 35,199, 47, 0) #23C72F00
9: (164,103, 4, 0) #A4670400
10: (227, 22, 4, 0) #E3160400
11: (172, 24, 8, 0) #AC180800
12: (255,255,255, 0) grey100
13: (208,208,208, 0) #D0D0D000
14: (173,173,173, 0) grey68
15: ( 77,137, 73, 0) #4D894900
Histogram:
4088: ( 44, 15, 50, 0) #2C0F3200
3623: ( 4, 4,162, 0) #0404A200
8943: ( 4, 23,223, 0) #0417DF00
5643: ( 3, 97,162, 0) #0361A200
4040: ( 17, 72,197, 0) #1148C500
6851: ( 3,161,100, 0) #03A16400
7489: ( 18,227, 21, 0) #12E31500
3466: ( 35,199, 47, 0) #23C72F00
5424: ( 99,164, 3, 0) #63A40300
406: ( 77,137, 73, 0) #4D894900
3156: (172, 24, 8, 0) #AC180800
4675: (164,103, 4, 0) #A4670400
5461: (227, 22, 4, 0) #E3160400
994: (173,173,173, 0) grey68
711: (208,208,208, 0) #D0D0D000
68158: (255,255,255,255) #FFFFFFFF
Rendering-intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 15kb
Interlace: None
Background Color: grey100
Border Color: #DFDFDF00
Matte Color: grey74
Page geometry: 387x344+0+0
Dispose: Undefined
Compression: LZW
Orientation: Undefined
comment: Image generated by AFPL Ghostscript (device=pnmraw)

signature:
3f0fad2b87d2cf9f9a0dba6186899f0cc91c7d0b3e8472282d3e25ae94b3 43bb
Tainted: False
User Time: 0.000u
Elapsed Time: 0:01
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: XObjView: Select Object and Opacity Problem
Next Topic: 8 to 24 bit conversion

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 00:11:52 PDT 2025

Total time taken to generate the page: 1.04275 seconds