change color of png image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SGerlach
Forum Newbie
Posts: 1
Joined: Mon Sep 18, 2006 9:22 am

change color of png image

Post by SGerlach »

Hi,

I have an png image (its 65x65 and is a gradient ) and I am trying to change the color. The original one is blue and i want to change it into different colors i.e. red, yellow, purple ect. I want to do this by preferably providing a rgb color ie. 220, 0, 0

any idea
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Search through onion2k's posts. He's talked on a number of occasions about color transforms.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

If you really mean change the colour of an image then it's something I've never actually managed. I've changed the hue.. that's not too tricky. Colour is a lot more difficult though .. brightness and saturation affect the output.

My fuzzy hue replacement code is here: viewtopic.php?p=254860#254860 .. it's mainly for changing the hue in a picture rather than something like a gradient though.
Post Reply