Both xbmImage and xbmRow have toString() methods


Both xbmImage and xbmRow have toString() methods: xbmImageString() and xbmRowString(), respectively. These create the ASCII representation of the XBM image when it’s time to display it.
A third method, xbmPartitionString(), optimizes the string-building process, which would otherwise consume an excessive amount of memory.