Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a simple black vector icon, and I want to change its color to an other color. I have this other color in hex.

I can use colorize but I can't achieve this color I have in hex.

How can I do it in GIMP?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Sounds like you have not a black icon but a grayscale icon. If your icon is nothing but black, gray (edges), and white background, then you can colorize it quite simply. First, convert your hex color to HSL color. Second, choose the Colorize tool and plug in your H, S, and L.

Converting from hex color to HSL color is pretty straightforward arithmetic but it is even easier to use an online converter (for example, http://serennu.com/colour/hsltorgb.php). Just be careful not to convert to HSV by mistake, because that is a different color system with a very similar name.

For example: Puce #cc8899 converts to H=345°, S=40%, L=67%. Plug 345, 40, and 67 into Colorize.

share|improve this answer
    
Thank you. This is very helpful. But I have small problem. As I have noticed I have my icon in black color. And I want to achieve it in color: 3B3737 HEX; 59,55,55 RGB. So I do everything like you have described, and I have achieved color 3A3535 HEX. This is very similiar to 3B3737 HEX. I am wondering how can I achieve exactly the color I want. –  woyaru Oct 22 '11 at 16:18
1  
Yes, the conversion from RGB to HSL and back to RGB can be imperfect because fractional values are truncated. Since you need an exact RGB match, I suggest an added step after the colorize. Because this is a less than 1% color correction, I assume it will not be necessary to correct the edges, just the main body of the icon. To color correct the 3A3535 pixels to 3B3737, load your paint bucket with 3B3737, select the bucket fill parameter "fill similar colors", set threshold to 0, and click in the area to be corrected. –  MετάEd Oct 24 '11 at 14:58

In gimp, click on the foreground color box in the toolbox to bring up the Change Foreground Color dialog. In this dialog, enter your hex value in the box to the right of the label HTML_notation and click OK. That will change the foreground color to your hex value.

Use the bucket fill tool to change the black portions of your icon to the foreground color.

Icon files can have multiple layers with different resolutions. Be sure you are editing a visible layer. You will have to change all layers (or just edit the highest resolution and then recreate the other layers using this method.)

share|improve this answer
    
Thank you for reply. I know this method. :) When I do all with your solution in my icon I lose transparent edges in my icon. So it isn't good solution for me. –  woyaru Oct 14 '11 at 22:26
    
what do you mean you lose the transparent edges? Does the icon then have a border? an image on this question would help. –  Ele Munjeli Oct 15 '11 at 18:11
    
Icon doesn't have a border, but the figure in the icon has semitransparent color on its edges. I can't upload image because it isn't freeware icon. –  woyaru Oct 16 '11 at 13:32
    
From what you are saying, it isn't a single colour, but has a transparent gradient at the edges. How about doing a select by colour and feathering the edges of the selection? –  Paul Oct 18 '11 at 1:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.