easily frame an object in a picture

what is the easiest way to frame a object in a .pgm.
I am right now trying something with reading the pixel values in a matrix and thereby determine how it should frame, but it just seem so complex for such an easy task.
Topic archived. No new replies allowed.