I have two grayscale Png files( https://i.stack.imgur.com/8RGh4.jpg ) that I want consider as a 2d array, so that I can apply masks to them.
What is the best way of doing this?
and if possible converting back, so I can show the masked images as my program works.
This is an assignment for university, just need to know how to get the data in, then I will do the rest.
Many thanks
You can then convert the
Imageinstance to aBufferedImageusing this:and then get the width and height of the image to loop through it, after you have that you can pretty much put it in any data structure you like. i.e:
now.. do the rest 🙂