Code: Select all
$image = imagecreatefrompng('test.png');
imagejpeg($image, 'test.jpg');
Moderator: General Moderators
Code: Select all
$image = imagecreatefrompng('test.png');
imagejpeg($image, 'test.jpg');
Code: Select all
for($x = 1; $x < $width; $x++) {
/*
* Getting values
*/
for($y = 1; $y < $height; $y++) {
/*****************/
}
}Code: Select all
$image = imagecreatefrompng('test.png');
for($x = 0, $lx = imagesx($image); $x < $lx; $x++)
for($y = 0, $ly = imagesy($image); $y < $ly; $y++){
$color = imagecolorat($image, $x, $y);
$params = imagecolorsforindex ($image, $color);
imagesetpixel($image, $x, $y, imagecolorallocate($image, $params['red'], $params['green'], $params['blue']));
}
//imagesavealpha($image, false);
imagejpeg($image, 'test.jpg');