Checking if a pixel is close to a specified colour with GD
Posted: Sat Dec 27, 2008 11:21 am
Hi everyone,
This is my first time posting here, it looks like a great site so I hope someone can assist with my problem. I'm currently attempting to write a PHP script that can examine each pixel in an image one by one and check whether it is the same as a specified colour (RGB value). The problem is there seem to be slight variations in the colours. The pixels that I want to identify are seemingly a number of different shades of the same colour, the differences are so minute that it is not noticeable when viewing the image but it causes problems for the software. What I want to achieve is to have a script that can take an RGB value and check if the pixels are roughly the same as the specified colour. I hope I have outlined my predicament clearly enough. Sorry for not having any code but at the moment I don't have anything of much value.
Thanks in advance.
This is my first time posting here, it looks like a great site so I hope someone can assist with my problem. I'm currently attempting to write a PHP script that can examine each pixel in an image one by one and check whether it is the same as a specified colour (RGB value). The problem is there seem to be slight variations in the colours. The pixels that I want to identify are seemingly a number of different shades of the same colour, the differences are so minute that it is not noticeable when viewing the image but it causes problems for the software. What I want to achieve is to have a script that can take an RGB value and check if the pixels are roughly the same as the specified colour. I hope I have outlined my predicament clearly enough. Sorry for not having any code but at the moment I don't have anything of much value.
Thanks in advance.