Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function black() {
- $imgname = "cheetah.png";
- $im = imagecreatefrompng ($imgname);
- $index = imagecolorexact ($im,0,0,0);
- imagecolorset($im,$index,255,0,0);
- $imgname = "cheetah2.png";
- imagepng($im,$imgname);
- }
- //------------------------------------------------------------------
- function white() {
- $imgname = "cheetah.png";
- $im = imagecreatefrompng ($imgname);
- $index = imagecolorexact ($im,255,255,255);
- imagecolorset($im,$index,0,0,0);
- $index = imagecolorexact ($im,0,0,0);
- imagecolorset($im,$index,255,255,255);
- $imgname = "cheetah2.png";
- imagepng($im,$imgname);
- }
- //-----------------------------------------------------------------
- if (isset($_GET['black'])) {
- black();
- }
- if (isset($_GET['white'])) {
- white();
- }
- clearstatcache();
- <div class="col-rep">
- <h3>Select a color in pallete and see the result:</h3><br>
- <img class="col-rep-img" src="cheetah.png">
- <a href="?black=true" class="black color"></a>
- <a href="?white=true" class="white color"></a>
- <img class="col-rep-img" src="cheetah2.png?1">
- </div>
Add Comment
Please, Sign In to add comment