Hi Fernando! I am even working on a script to do this these days, - map a palette to an image based on value information (not nearest color - as the GIMP does, but buy color value: black is mapped to first color in palette and so on).
Unfortunattely, the GIMP can only handle indexed images with 256 colors. My script _can_ map a palette to an RGB image, but currently, as I said, I am using the pixel Value to do that - and there are only 256 color values allowed in 8bit RGB . :-(. For Value here I mean the Pixl Value in HSV color model, which is MAX (R,G,B) Moreover, I use a trick with the the GIMP curves tool to do that, aand the curves tool will also only use 256 colors. How many colors do you need? if less then 512, I can think of a trick whicth I could tune my script to do automatically - using another component besides pixel Value - possibly the Red channel - to have more than 256 target colors. This would map, again, in palette order. If you want the nearest color, the better thing to do is to get yourself a Patch to the gimp core, in which an image is mapped to a palette, but remains RGB, using the same algorithims thgat are there already. I think I could provide sucha a patch, that would hardly make it into the official GIMP. It would be a thing for your use only, at least for a while. That would use some of my work time - so, what I mean, is, how much do you need this? BTW, all my scritps are gimp-python. I will mail you my palette mapping script in private anyway - at least you can study it. Unfortunnately, the GIMP On Sunday 17 October 2004 13:52, Fernando Sancho wrote: > Hi all. > > I'm new to the list. I have joined because I need help. > > I'm making a gimp-python scipt to create cross stitch patterns from > an image. Reading list's archives i've founded this > http://www.mail-archive.com/[EMAIL PROTECTED]/msg011 >27.html > > I don't know if Carol has completed his idea. By now, i'm > evaluating how much work can make gimp by itself. > > The feature that i can't find in gimp is to map an image with a > custom palette (DMC Floss colors). Gimp only allows me to convert > from RGB to Indexed mode, but it doesn't allow to choose a custom > pallete with more than 256 colours, and doesn't allow to choose the > maximum number of colours. > > Any help? > > Thanks in advance > _______________________________________________ > Gimp-user mailing list > [EMAIL PROTECTED] > http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user _______________________________________________ Gimp-user mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user