Java Loop through pixels in an image?

Hey guys i’m trying to find a way to make maps for my 2D java game, and I thought of one Idea in which I would loop through each pixel of an image and depends on what colour the pixel it was that …