![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
07/11/2011, 20:32
|
| | Fecha de Ingreso: marzo-2010
Mensajes: 17
Antigüedad: 14 años, 10 meses Puntos: 1 | |
Respuesta: imagecreate bueno, ya consegui cambiar el color de esta forma, solo me faltaria la transparencia :P
<?php
$im = imagecreatefrompng("o2.png");
$size = getimagesize("o2.png");
$L=$size[0];
$H=$size[1];
for($j=0;$j<$H;$j++){
for($i=0;$i<$L;$i++){
$rgb = imagecolorat($im, $i, $j);
$red = 0;
$green = 0;
$blue = 0;
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
if(($r==255)&&($g==255)&&($b==0)) {
$color = imagecolorallocate(
$im, $red, $green, $blue);
imagesetpixel($im, $i, $j, $color);
}
}
}
header("Content-type: image/png");
imagepng($im);
?> |