RSS/Atom feed Twitter
Site is read-only, email is disabled

palette mapping

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

palette mapping Fernando Sancho 17 Oct 17:52
  palette mapping Carol Spears 17 Oct 18:54
  palette mapping Jeff Trefftzs 17 Oct 21:16
  palette mapping Joao S. O. Bueno Calligaris 18 Oct 02:17
   palette mapping Alan Horkan 18 Oct 21:47
Fernando Sancho
2004-10-17 17:52:14 UTC (over 19 years ago)

palette mapping

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/gimp-user@lists.xcf.berkeley.edu/msg01127.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

Carol Spears
2004-10-17 18:54:09 UTC (over 19 years ago)

palette mapping

On Sun, Oct 17, 2004 at 05:52:14PM +0200, Fernando Sancho wrote:

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/gimp-user@lists.xcf.berkeley.edu/msg01127.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 story of the counted cross stitch program is long and involves a few lost websites and hard disks.

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.

one thing, the gimp palettes are just lists of numbers in a text file, not an image. so you can easily make up your own palette.

i had a pallete like this in which Jeff Trefftz improved upon. the gimp can use and displace palettes with any number of entries. the indexing dialog can only use palettes with 256 colors or less. it is not gimp, it is the laws of indexing. i dont even think it is a copyright problem, i think this is a math problem.

i just found a cross stitch script-fu online, but it was through a moderated mail lists archives. i have to look at it to see if i can share it or not.

making your own script to do this is a great thing to learn to script gimp with. the first time i got gimp to use the pixelize filter from a script was a neat feeling. the problem with this script is that you have to figure out how to choose the best color from the dmc palette. if you ask for help, they will show you physics papers about color spaces -- i dont suggest this.

i hope i answered your question,

carol

Jeff Trefftzs
2004-10-17 21:16:40 UTC (over 19 years ago)

palette mapping

On Sun, 2004-10-17 at 08: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/gimp-user@lists.xcf.berkeley.edu/msg01127.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?

The good news is that there is already a script-fu script to do this. The bad news is that you can't use a palette with more than 256 colors, because the script quantizes the original image's color information by converting it to indexed, which allows only 8 bits worth of color information.

I have attached the script - note that the default values aren't very good. Cross-stitch seems to need at least a larger brush (Circle 03) and longer stitches (9 pixels per stitch seemed to work). Keep trying until you get what you want.

Be warned - use of this script may leave your original image in an unrecoverable state - better always work on a copy.

HTH

Joao S. O. Bueno Calligaris
2004-10-18 02:17:21 UTC (over 19 years ago)

palette mapping

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/gimp-user@lists.xcf.berkeley.edu/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

Alan Horkan
2004-10-18 21:47:50 UTC (over 19 years ago)

palette mapping

On Sun, 17 Oct 2004, Joao S. O. Bueno Calligaris wrote:

Date: Sun, 17 Oct 2004 22:17:21 -0200 From: Joao S. O. Bueno Calligaris
To: Fernando Sancho , gimp-user@lists.XCF.Berkeley.EDU Subject: Re: [Gimp-user] palette mapping

Unfortunattely, the GIMP can only handle indexed images with 256 colors.

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?

There may be a way to get what you want that is more generally useful.

Animated GIF can have a different palette for each layer which some people have used to workaround the 256 colour limit.

- Alan