From: Alan W. I. <ir...@be...> - 2001-11-28 03:02:38
|
On Wed, 28 Nov 2001, Andrew Roach wrote: > >whatever). Now in order to work with colour images in plplot you do need > >the appropriate colour pallette defined for cmap1, but the png format, for > >example, does allow for up to 256 different colours in a pallette. (png > >format also has the truecolour alternative, but we must avoid that because > >plplot would not be able to work with it.) > > Is that /really/ true ? I must confess I have not looked at the code yet > (or for months), but I didn't think that plplot /was/ limited to 256 > colours. my last look at the colourmap stuff made me think it could easily > cope with more than that. The current PNG driver is limited to 256 because > the 1.? versions of GD didn't support truecolour, but unless I am mistaken > plplot should be "open" enough to support more than 256 colours already. > 16.5 million might be pushing it, but all the same... Someone please > correct me if I am wrong. I agree plplot can cope with almost arbitrary numbers of colours in cmap1 so it is possible to get rid of the 256 limit in the png driver. However, I was talking about the png format palette limit above and not libgd or cmap1. Sorry for that misunderstanding. For a reference on this 8-bit limit for the png palette, see http://www.w3.org/TR/PNG-Chunks.html#C.IHDR. Later, in an update I did talk about libgd where there is a function called gdImageTrueColorToPalette to convert from truecolor to palette. It is largely undocumented except for the header file so I don't know what the limitations are there on the number of palette indices, but I assume it is pretty likely it conforms to the 256 png limit above. > I was sleeping while most of these discussions were going on - you forget, > I am on the other side of the world from most of you guys :-) I was going > to have a look at it today and see what was to be done. Let me know what > progress you're making and let see what happens. Excellent progress. It truly is just a small number of lines of code. Gray scale works fine and I am close on the colour image as well. See comment I will make to Joao's question about colour images. Alan |