Code: Select all
$image = 'test.jpg';
$imageSize = getimagesize($image);
for($w=0; $w<=$imageSize[0]; $w++){
for($h=0; $h<=$imageSize[1]; $h++){
$txt[$w][$h] = exec('convert '.$image.'[1x1+'.$w.'+'.$h.'] txt:');
}
}
debug($txt);
Code: Select all
Array
(
[0] => Array
(
[0] => 0,0: (255,255,255) #FFFFFF white
[1] => 0,0: (255,255,255) #FFFFFF white
[2] => 0,0: (255,255,255) #FFFFFF white
[3] => 0,0: (255,255,255) #FFFFFF white
[4] => 0,0: (255,255,255) #FFFFFF white
[5] => 0,0: (255,255,255) #FFFFFF white
[6] => 0,0: (255,255,255) #FFFFFF white
[7] => 0,0: (255,255,255) #FFFFFF white
[8] => 0,0: (250,250,250) #FAFAFA grey98
[9] => 0,0: (255,255,255) #FFFFFF white
[10] => 0,0: (251,251,251) #FBFBFB rgb(251,251,251)
[11] => 0,0: (255,255,255) #FFFFFF white
[12] => 0,0: (255,255,255) #FFFFFF white
[13] => 0,0: (248,248,248) #F8F8F8 rgb(248,248,248)
[14] => 0,0: (251,251,251) #FBFBFB rgb(251,251,251)
[15] => 0,0: (255,255,255) #FFFFFF white
[16] => 0,0: (255,255,255) #FFFFFF white
[17] => 0,0: (255,255,255) #FFFFFF white
[18] => 0,0: (255,255,255) #FFFFFF white
[19] => 0,0: (254,254,254) #FEFEFE rgb(254,254,254)
[20] => 0,0: (252,252,252) #FCFCFC grey99
)
[1] => Array
(
[0] => 0,0: (255,255,255) #FFFFFF white
[1] => 0,0: (255,255,255) #FFFFFF white
[2] => 0,0: (255,255,255) #FFFFFF white
[3] => 0,0: (255,255,255) #FFFFFF white
[4] => 0,0: (255,255,255) #FFFFFF white
[5] => 0,0: (255,255,255) #FFFFFF white
[6] => 0,0: (255,255,255) #FFFFFF white
[7] => 0,0: (255,255,255) #FFFFFF white
[8] => 0,0: (255,255,255) #FFFFFF white
[9] => 0,0: (250,250,250) #FAFAFA grey98
[10] => 0,0: (250,250,250) #FAFAFA grey98
[11] => 0,0: (251,251,251) #FBFBFB rgb(251,251,251)
[12] => 0,0: (254,254,254) #FEFEFE rgb(254,254,254)
[13] => 0,0: (252,252,252) #FCFCFC grey99
[14] => 0,0: (250,250,250) #FAFAFA grey98
[15] => 0,0: (255,255,255) #FFFFFF white
[16] => 0,0: (248,248,248) #F8F8F8 rgb(248,248,248)
[17] => 0,0: (248,248,248) #F8F8F8 rgb(248,248,248)
[18] => 0,0: (251,251,251) #FBFBFB rgb(251,251,251)
[19] => 0,0: (255,255,255) #FFFFFF white
[20] => 0,0: (255,255,255) #FFFFFF white
)
);