: hi. i have problem in which i need to Scan the image and retrieve the Green part of every pixel. Convert the result to ascii symbols. but i have no idea how to even start can someone help plzzzzzzzzzzz
:
Depending on the colordepth, this can be quite simple. If the colordepth is 24 then each pixel is coded using the RGB-method. This means that the first three bytes are red-green-blue. The fourth is usually not used, but can indicate a system color.
Other commonly used methods include using a palette of colors. All you need to do then is build a reference table of the greens based on the palette, and then use that table to read the pixels.
As for scanning the image, this might be can be best done using a bitmap. So the first part is to get the image's bitmap, which can be quite easy (a windows bitmap) or quite difficult (a jpeg). I don't have any source codes on these things, so I cannot help you with that.
Once you got the bitmap, it is usually given in a 2D-array, which you can easily scan using 2 for-do loops to get to each pixel.
The conversion to ascii symbols can be easily done by type-casting or by using a reference string. Examples:
var
PixelGreen: byte;
AsciiCode: char;
begin
...
AsciiCode := char(PixelGreen);
...
end;
const
HexDec: string = '0123465789ABCDEF';
PixelGreen: byte;
AsciiCode: char;
begin
...
AsciiCode := HexDec[PixelGreen+1]; { +1 because a string is 1-indexed }
...
end;
I hope this gives you a place to start.