Alan, Thanks a lot for your explanation. I had no idea that I was using "old, unmaintained and deprecated" functionality :-).
I have no real rason for "gif" files, so I will try to switch to another driver. Thans again. Hans. -----Original Message----- From: Alan W. Irwin [mailto:ir...@beluga.phys.uvic.ca] Sent: Thursday, September 17, 2009 17:55 To: Rijneke, Hans H SIEP-EPT-RIS Cc: plplot-general@lists.sourceforge.net Subject: Re: [Plplot-general] Maximum number of colour for colour map "cmap0" On 2009-09-17 14:40+0200 hans.rijn...@shell.com wrote: > Dear All, > > I got some problems when I had a colour table with 150 colours in cmap0 and > then wanted to create a "gif" file from that. I got an error like "Too many > colours in cmap0". > > Looking through the code it turned out to be cuased by the "gd.c" driver. > This one takes the maximum number of colours "NCOLOURS" from "gdMacColors" > (which is defined as 256 in the header file gd.h). But at a certain moment > the number of colours as defined for the cmap0 colour table is compared with > "NCOLOURS/2" (see line815 in gd.c). > > So, as I have 150 colours in my map, I now get this error as it exceeds 128 > and my "gif" file is not what I wanted. > > Is there a special reason why only half of the colours is allowed here ? > > (I removed that limitation by just testing at NCOLOURS and now my picture > looks as expected) Hi Hans: The png, jpeg, and gif devices are all implemented via the gd device driver which is unmaintained, deprecated, and not removed at the moment simply because some legacy Linux "enterprise" distros don't have access to good versions of the stack of cairo-related libraries and/or the Qt libraries. The gd device driver has major issues with unicode font handling, rendering of complex-text-layout (CTL) languages, and text offsets which are all solved with the cairo devices and the qt devices. There are much better alternatives for JPEG format (use jpgqt) and PNG format (use pngqt or pngcairo). The GIF format has some technical limitations (such as lack of a large colour space) so you may find you far prefer the PNG format (either pngqt or pngcairo) instead. However, if for some legacy reason you really need GIF, then I think the best way to implement that with PLplot is to generate PNG format with PLplot and then use the ImageMagick convert programme to generate the corresponding GIF. I hope this overview helps you and others here make a good choice of PLplot bitmapped device drivers. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Plplot-general mailing list Plplot-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-general