table = BrushToPenArray(id)
Note that the rows won't be stored as subtables. The table returned by
BrushToPenArray()
will be one-dimensional and will contain exactly
$height * $width elements, stored sequentially, row after row.
Please note that the table that you get from this function will usually eat lots of memory. Thus, you should set this table to Nil as soon as you no longer need it. Otherwise you will waste huge amounts of memory and it could even happen that your script runs out of memory altogether. So please keep in mind that you should always set pixel array tables to Nil as soon as you are done with them.
To convert a pen array back to a palette brush, you can use the PenArrayToBrush() function. See PenArrayToBrush for details.
If you want to have RGB colors instead of pen values, you have to use
the BrushToRGBArray()
function instead.
See BrushToRGBArray for details.