I have not tried anything of this yet, simply because I have no idea on how to get started with this.
What I'm trying to do is to create a PHP file that can read each vertical Line of pixels in a 2 Colour Image and return a Percentage of the heighest pixel in a certain Color.
Let me explain some more.
Lets say you have a Image of two colours, Black AND White. Like this ..
How would you start reading this image from left to right and take the heighest BLACK pixel for each vertical row of pixels from bottom to top?
Can somone please point me in the right direction or provide some part of code that might help me get started with this.
Thanks in advance.
You can try something like this. But be carefull with the exact value of the black.
$im = imagecreatefrompng("php.png")
list($width, $height) = getimagesize('path_to_image');
$heights = array();
for($i = 0; $i < $width ; $i++){
for($j = 0 ; $j < $height ; $j++){
if(imagecolorat($im, $i, $j) == 0){
$heights[] = $j;
break;
}
}
}