Most likely the logic is at least similar. Yes, line by line, each line is encoded in bytes where each bit is a pixel. I had to "invert" the image as the printer will print the "white" pixels (those with a value >0).
The printer has an internal buffer so you can send multiple lines at the same time, but on the bear this starts to break down after 200 lines or so (consider that the bear has a higher 300 dpi resolution, so 576 pixel per line). Also pay attention to overheating, I put 1 or 2 seconds of pause every 400 lines just in case.