This function creates an object of class "im" representing
a two-dimensional pixel image. See im.object
for details of this class. Note that the row index of the matrix mat corresponds
to increasing y coordinate, while the column index of mat
corresponds to increasing x coordinate. Thus
xrow has one entry for each row of mat
and ycol has one entry for each column of mat. A correct
display of the image would be obtained by transposing, e.g.
image.default(xcol, yrow, t(mat)), if you wanted to do it by hand.