From: Alan W. I. <ir...@be...> - 2001-11-28 03:44:04
|
On Wed, 28 Nov 2001, [iso-8859-1] Jo=E3o Cardoso wrote: > You want to write a tutorial; I just want to show that it can be > done. You want to write code that users can modify to theirs needs; I > just want to show them that it can be done. > > I profoundly disagree (as you said) on puting library dependencies on > demos. It is not a question of being nice to have color images, but a > question of software development. Note, I am leaving in your gray-scale image reading since it now works, and I am simply adding another page for a colour image. We can straightforwardly configure out the colour image reading in x20c.c for the case where the user does not have libgd installed. Thus, I don't believe there is any cause for your concern here since your work is essentially left unaffected. > ....(lots of example code from octave deleted) > To continue, reducing the palete to 256 colors, I need a definition > of what a "near color" to other color is. I am running into a problem with the plimage colour image that may be relevant to your question. The problem is the index range is effectively stored as a floating point number and converted inside plimage to the range 0. --> 1, then a call to plcol1 is made. That is all well and good, but I a= m just starting to review the plcol1 code now to see how the 0. to 1. range i= s mapped to the colour palette index range. For colour images that index mapping has to be exact. If there is an off-by-one error in the resulting index it makes very little difference to gray-scale images since the colour palette is continuous in that case. However, such an error would make a hug= e mess for non-continuous colour palettes that occur for most colour images. = I am getting such a colour mess at the moment (poor Lena has surreal colours!= ) while the identical set of calls to libgd and plimage work fine if the lena.png image is gray-scale. That is why I am looking for off-by-one error= s in plcol1. Alan |