Alex Rivera | Logout

How to change the colors of a PNG image easily?

Asked 2011-05-19T13:49:35.357
17

I have PNG images that represent playing-cards. They are the standard colours with Clubs and Spades being blank and Diamonds and Hearts being red.

I want to create a 4-colour deck by converting the the Clubs to green and the Diamonds to blue.

I don't want to re-draw them but just changing them by hand seems a lot of work since the colours are not all "pure" but graded near the edges.

How do I do it?

Edit
Report

2 Answers

7

This should be fairly straightforward in the gimp http://gimp.org/

First make sure your image is RGB (not indexed color) then use the "color to alpha" feature to turn the clubs/diamonds clear, then fill or set the background or whatever to get the color you want.

answered 2011-05-19T13:54:01.327
5

If you are going to be programming an application to do all of this, the process will be something like this:

  1. Convert image from RGB to HSV
  2. adjust H value
  3. Convert image back to RGB
  4. Save image
answered 2011-05-19T13:58:15.083

Your Answer