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

Apply palette to image colormap

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.

8 of 8 messages available
Toggle history

Please log in to manage your subscriptions.

Apply palette to image colormap Joao S. O. Bueno Calligaris 31 May 21:25
  Apply palette to image colormap Kevin Cozens 01 Jun 05:03
   Apply palette to image colormap Sven Neumann 01 Jun 17:48
   Apply palette to image colormap Joao S. O. Bueno Calligaris 01 Jun 18:15
    Apply palette to image colormap Kevin Cozens 01 Jun 23:25
    Apply palette to image colormap Alan Horkan 02 Jun 15:30
     Apply palette to image colormap Kevin Cozens 02 Jun 16:59
      Apply palette to image colormap Sven Neumann 02 Jun 21:38
Joao S. O. Bueno Calligaris
2005-05-31 21:25:31 UTC (over 19 years ago)

Apply palette to image colormap

Hi,

It seems this fucntionality exists in other programs but not in the GIMP - i.e.: the ability to apply a palette to an already indexed image, keeping the color numbers.

This is easily doable in script, but it could also be done in the core (and them DND palettes from the palette to the color map dialog, or to the image window could be made to work).

Which solution do you think would be better?

Regards, João

Kevin Cozens
2005-06-01 05:03:19 UTC (over 19 years ago)

Apply palette to image colormap

Joao S. O. Bueno Calligaris wrote:

It seems this fucntionality exists in other programs but not in the GIMP - i.e.: the ability to apply a palette to an already indexed image, keeping the color numbers.

This is easily doable in script, but it could also be done in the core

One of the scripts in Tiny-Fu is called tiny-fu-set-cmap.sct and provides the functionality you are talking about. I think it is a feature useful enough that it should be included as part of the core. It would also run a lot faster than my scripted version.

Sven Neumann
2005-06-01 17:48:13 UTC (over 19 years ago)

Apply palette to image colormap

Hi,

Kevin Cozens writes:

It seems this fucntionality exists in other programs but not in the GIMP - i.e.: the ability to apply a palette to an already indexed image, keeping the color numbers.

This is easily doable in script, but it could also be done in the core

One of the scripts in Tiny-Fu is called tiny-fu-set-cmap.sct and provides the functionality you are talking about. I think it is a feature useful enough that it should be included as part of the core. It would also run a lot faster than my scripted version.

Performance shouldn't be a problem here but having this feature in the core would probable allow for a better user interface.

Sven

Joao S. O. Bueno Calligaris
2005-06-01 18:15:33 UTC (over 19 years ago)

Apply palette to image colormap

On Wednesday 01 June 2005 00:03, Kevin Cozens wrote:

Joao S. O. Bueno Calligaris wrote:

It seems this fucntionality exists in other programs but not in the GIMP - i.e.: the ability to apply a palette to an already indexed image, keeping the color numbers.

This is easily doable in script, but it could also be done in the core

One of the scripts in Tiny-Fu is called tiny-fu-set-cmap.sct and provides the functionality you are talking about. I think it is a feature useful enough that it should be included as part of the core. It would also run a lot faster than my scripted version.

Ah..thre it is.
Anyway - the person needing this right now is on win32 - Will this script work in script-fu?

And... it is buggy. It failed me when applying 256 color palette to a 256 colro image with the message:
---
Error while executing
(tiny-fu-set-cmap 6 12 "Gold")

Error: car: argument 1 must be: pair --
Not to mention:

WARNING: Plug-In "tiny-fu" (/usr/local/lib/gimp/2.0/plug-ins/tiny-fu) called deprecated procedure 'gimp_image_set_cmap'. It should call 'gimp_image_set_colormap' instead!

(ooopss... I remember being the one who asked that this particular procedure got renamed before 2.2 )

Kevin Cozens
2005-06-01 23:25:06 UTC (over 19 years ago)

Apply palette to image colormap

Joao S. O. Bueno Calligaris wrote:

Anyway - the person needing this right now is on win32 - Will this script work in script-fu?

It should work but you will need to change the filename to end in .scm and change all occurances of 'tiny-fu' in the script to 'script-fu' (preserving case). You can try calling a Tiny-Fu script from Script-Fu but I don't know if it will work. The Script-Fu copy of the set-cmap script I have on my own machine works fine.

called deprecated procedure 'gimp_image_set_cmap'. It should call 'gimp_image_set_colormap' instead!

Well spotted. I have changed the call in the CVS copy of Tiny-Fu. I wonder if I should use colormap instead of cmap in the name of the routines defined by the script?

Alan Horkan
2005-06-02 15:30:59 UTC (over 19 years ago)

Apply palette to image colormap

And... it is buggy. It failed me when applying 256 color palette to a 256 colro image with the message:
---
Error while executing
(tiny-fu-set-cmap 6 12 "Gold")

Error: car: argument 1 must be: pair --
Not to mention:

WARNING: Plug-In "tiny-fu" (/usr/local/lib/gimp/2.0/plug-ins/tiny-fu) called deprecated procedure 'gimp_image_set_cmap'. It should call 'gimp_image_set_colormap' instead!

Normally I'd be in favour of expanding abbreviations to make things clearer but in this case the shorter deprecated name avoids the confusion caused by the American mispelling of Colour (damned Webster and his patriotic neologisms).

- Alan H

Kevin Cozens
2005-06-02 16:59:18 UTC (over 19 years ago)

Apply palette to image colormap

Alan Horkan wrote:

It should call 'gimp_image_set_colormap' instead!

Normally I'd be in favour of expanding abbreviations to make things clearer but in this case the shorter deprecated name avoids the confusion caused by the American mispelling of Colour (damned Webster and his patriotic neologisms).

Good point, Alan. Being one of those people who includes the 'u' makes me think I'm better off leaving my script functions using cmap instead of colormap/colourmap.

Sven Neumann
2005-06-02 21:38:45 UTC (over 19 years ago)

Apply palette to image colormap

Hi,

Kevin Cozens writes:

Being one of those people who includes the 'u' makes me think I'm better off leaving my script functions using cmap instead of colormap/colourmap.

I think you should stick as closely to the GIMP API as possible and use colormap instead of an ambiguous abbreviation.

Sven