![]() |
|
#1
|
||||
|
||||
![]()
Recoloring an image is pretty easy, just kinda annoying to do. I'll be using GIFs as an example, because this method changes color by individual pixels, and PNGs can have lots of colors while GIFs generally have a more defined palette.
For this, we use the function imagecolorset as well as imagecolorexact. imagecolorset changes the defined color to a new one, while imagecolorexact picks the exact color we want to change. There are other functions to grab colors as well, but I find imagecolorexact to be the more flexible (there is also imagecolorclosest, which I've never tried to use and just discovered while typing up this tutorial. Sounds nicer though (grabs a color close to the one you selected if the one you selected doesn't exist), so I almost suggest using that XD). There's also imagecolorat which just defines it based on the specified pixel (x,y). It's very inflexible, so I don't really suggest using it. PHP Code:
imagecolorexact(IMAGE,RED,GREEN,BLUE); IMAGE is your image. This is so it can get the color palette from your image RED the red value of the color (value between 0-255) GREEN the green value of the color (value between 0-255) BLUE the blue value of the color (value between 0-255) DERP. I DECIDED TO START WRITING THIS IN THE MIDDLE OF CLASS. But now I have work to do sooooooo this will be left half finished until I get around to it. Sorry XD
__________________
![]() "I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo My Adoptables|Nuzlocke Webcomic Last edited by PTGigi; 10-19-2012 at 09:46 AM. |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Editing Side Bar Links | GuardiansWish | Questions and Supports | 4 | 10-22-2012 08:18 AM |
Editing adoptables | Papyrus | Questions and Supports | 2 | 01-24-2012 05:53 AM |
Editing the HTML side of the CSS? | Sasoragon | Questions and Supports | 6 | 02-17-2011 09:40 AM |
Editing Content | Rozel | Questions and Supports | 4 | 01-29-2011 12:14 PM |
Editing pages. | Saphira | Questions and Supports | 1 | 01-11-2009 04:46 PM |
What's New? |
What's Hot? |
What's Popular? |