php image imagecreatefrompng test png define _STEP_H define _STEP_W de

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
$image = imagecreatefrompng('test.png');
define('_STEP_H', 2);
define('_STEP_W', 2);
define('_IMG_H', imagesy($image));
define('_IMG_W', imagesx($image));
$_img_h = _IMG_H;
$_img_w = _IMG_W;
$pixels_count = 0;
while ($_img_h > 0) {
while ($_img_w >= 0) {
$res = imagecolorat($image, $_img_w, $_img_h);
$pixels_count++;
$_img_w = $_img_w -_STEP_W;
var_dump($res);
echo '<br />';
flush();;
}
die();
$_img_w = _IMG_W;
$_img_h = $_img_h -_STEP_H;
}
echo "Pixels >".$pixels_count;
imagedestroy($image);