Save a picture of a maze

I have a maze generator, and I want to be able to save the mazes it makes as .png files. My generator makes mazes with squares, and in the save files, I want each square on the maze to be 1 pixel. Does anyone know how to do this? Here is an example generated maze: Maze

Say you create a maze that is 128 squares by 128 squares. You can then create a new Texture2D(128, 128). Then, you iterate over your maze determining what each square is at position (x, y). Then you determine what color you want that type of square to be represented as. Then, you say texture.SetPixel(x, y, color); After you get done iterating over everything, you need to convert it to a byte array by saying texture.EncodeToPNG(); Lastly, you need to save the file by saying File.WriteAllBytes(, );.