$img_path = $path . 'out_img.png';
$im = imagecreatefrompng($img_path);
$width = ImageSX($im);
$height = ImageSY($im);
$im2 = imagecreatetruecolor($width, $height);
for ($y = 0; $y < $height; $y++) {
for ($x = 0; $x < $width; $x++) {
$rgb = imagecolorat($im, $x, $y);
if ($rgb != 0) {
$color_rgb = imagecolorsforindex($im, $rgb);
$alpha = $color_rgb['alpha'];
sage($color_rgb);die();
}
}
}