Skip to main content
GameDev.net gamedev.net
🔒 Locked

taking

Started by stroma Nov 3, 2004 at 4:55 PM 3 replies 450+ views
Original Post
stroma
stroma
first i must say that my english is not good, and the problem is not easy to explain. i think it is a image processing question. i have a picture with a ball or etc. i want to select the ball from the picture and take some variable arrays from this non-rerctangular area's colors and this colors' positions. how can i select the different area? can it be a answer using arrays that calculates previous pixel color and make some math to select odd color area? (for example a red ball on grasses) (the picture does not have to be color. it can be black&white) i think, the main question should be: how can i take x,y coordinate's color from picture.bmp file? anyway i am waiting for your replies.. thank you....
+-+-+-+-+-STR
Zakwayda
Zakwayda
It sounds like you're talking about image analysis - finding outlines and so forth - the type of thing Photoshop does. Pretty complicated stuff, I imagine. But if I understood your last question correctly...

To just have access to the image data, you need to load the .bmp into memory, and then you need to know a) the file format and b) the image format.

The file format will tell you where the actual image data is. Then, for the image data you will need to know the size (width and height) of the image, and the pixel format (16 bit R5G5B5A1, 24 bit, 32 bit, or whatever).

Once you have that information, you can start scanning the image and performing whatever operations you wish. Operations such as removing, isolating, or changing certain colors or color ranges should be fairly straightforward. But I'd think more advanced processes would get pretty complicated pretty quickly.
stroma
stroma
are there any article around here? i think there are some formulas...
and what about taking pixel colors? there should be some simple functions for this?
thank you...
+-+-+-+-+-STR
stroma
stroma
i wont use different images, i mean the bpp, or h,w will not change during the program. taking their values is the easy one. :D
+-+-+-+-+-STR
stroma
stroma
heheh after google search i found the usage of getpixel function for my idea. but still i need some articles about images..
+-+-+-+-+-STR

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.