Gimptalk - Premier Gimp Community: Colormap transalation - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Colormap transalation

#1 User is offline   edog5948 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 17-December 09

Posted 17 December 2009 - 04:11 PM

Hi -

I've got a web template that uses a 'green' indexed colormap for all it's images.
The web template has maybe 15-20 images, including buttons, backgrounds, etc.

My client wants the template to appear 'purple'.
I was trying to convert the green colormap to a purple colormap.

This worked find for simple images. But, I found out that most of the buttons have 187 colors in their colormap. Way too much to match manually.

So my questions are:
1) What's the best approach to change the green images to purple images?
2) If modifying the colormaps is the method, are there an automated capabilities?
3) any other suggestions for this task?

Thanks in advance.
0

#2 User is offline   NightVoid 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 07-February 10

Posted 07 February 2010 - 08:42 AM

I don't know how to do it in gimp, at least not as well... but if you still need help with this.

I use “Photo Filtre” for this task. It has a tool called ”Replace Color Range”
It will replace all of a given color in its various hues with another color range.

The program is free or at least has a free version. I use it for simpler tasks.


I know this is a GIMP forum, as of yet I haven't figured out how to do this in GIMP.
But if someone knows... I too would like to learn how to do this in GIMP.

Anyway I hope this helps.
0

#3 User is offline   saulgoode 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 5,324
  • Joined: 22-August 05

Posted 07 February 2010 - 09:50 AM

Check out this script which allows you to change the hue of colors in indexed images.
Everybody makes their own fun. If you don't make it yourself it's not fun, it's entertainment.
0

#4 User is offline   ckin 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 08-February 10

Posted 09 February 2010 - 01:20 AM

Related area: we'd like to take a certain unique color in an image
(a dye used in a science experiment), represented by an [R,G,B]
triplet, and "rotate" its hue in HSV space to just G (for example).
Then the G color layer would contain an image of only the dyed
regions in the image.

Am I thinking correctly about this? If so, what's the best way
to do this in GIMP?
0

#5 User is offline   RobA 

  • Member
  • PipPip
  • Group: Members
  • Posts: 689
  • Joined: 05-November 07

Posted 09 February 2010 - 02:08 PM

ckin said:

Related area: we'd like to take a certain unique color in an image
(a dye used in a science experiment), represented by an [R,G,B]
triplet, and "rotate" its hue in HSV space to just G (for example).
Then the G color layer would contain an image of only the dyed
regions in the image.

Am I thinking correctly about this? If so, what's the best way
to do this in GIMP?


I have most of the stuff needed in scripts already.

The scheme code to get Hue from a RGB colour is:
  ; takes (list R G B)  as 0-255, returns H as 0-360
  (define (GetHue color) 
    (let* (
      (R (/ (car color) 255)) 
      (G (/ (cadr color) 255)) 
      (B (/ (caddr color) 255)) 
      (maxRGB (max R G B)) 
      (minRGB (min R G B)) 
      (H (cond 
           ((= maxRGB minRGB) 0)
           ((= maxRGB R) (+ (* 60 (/ (- G B) (- maxRGB minRGB))) 360))
           ((= maxRGB G) (+ (* 60 (/ (- B R) (- maxRGB minRGB))) 120))
           ((= maxRGB B) (+ (* 60 (/ (- R G) (- maxRGB minRGB))) 240))
         )))
      (when (< H 0) (set! H (+ H 360)))     ;modulo
      (when (>= H 360) (set! H (- H 360)))  ;for real numbers
      H ;return value
    )
  )


so you can just call the built in hue/sat pdb call:

        (gimp-hue-saturation  ALL-HUES (- 100 (/ (GetHue ) 1.8))0 0)


would shift the hue you want to the Red channel. (Red is 0 hue)

-Rob A>
Posted Image
Fantasy Cartography and Mapping by RobA
0

#6 User is offline   RobA 

  • Member
  • PipPip
  • Group: Members
  • Posts: 689
  • Joined: 05-November 07

Posted 09 February 2010 - 02:15 PM

....Thinking about it, there is a problem in that that will only work on hue, not sure of S and L are important in the selection process...

Another way that might work is to use the Layer->Transparency->Colour to Alpha and set your rgb colour.

The alpha channel should now reflect your colour.

-Rob A>
Posted Image
Fantasy Cartography and Mapping by RobA
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic