I am making a game, And I want to be able to draw a level in photoshop. And the game to read it.
For this, I need a way to determine what are rectangles in a picture.
For example, I have this kind of picture:
And I want the program to realize what is a rectangle, What it's size and position.
Like this:
(Rectangles highlighted in red.)
I thought about using a For loop for each Y value. And reading the green pixels one by one. But I just can't figure out the logic. And my head hurts when I think about it too much.
Any genius that can help me?
For this, I need a way to determine what are rectangles in a picture.
For example, I have this kind of picture:
And I want the program to realize what is a rectangle, What it's size and position.
Like this:
(Rectangles highlighted in red.)
I thought about using a For loop for each Y value. And reading the green pixels one by one. But I just can't figure out the logic. And my head hurts when I think about it too much.
Any genius that can help me?