- Can PHP process images as matrices like MATLAB?
- $width = 1024;
- $length = 768;
- $myImage = array();
- for($i = 0; $i < $width; $i++){
- for($i2 = 0; $i2 < $width; $i2++){
- // X Y
- $myImage[$i][$ii] = array(
- 'red' => 0,
- 'green' => 0,
- 'blue' => 0,
- 'alpha' => 0);
- }
- }
- foreach($myImage[500] as &$pixel){
- $pixel['red'] = 255;
- }