Lunar Tech Misadventures 006
New Label Printer and SCP Themed Stickers

2023-10-26

I got a label printer!

Label printers are Very Cool. I wanted one ever since I first saw a label printer as a child. There are still labels on the door to my room at my parents' place from the one time I got to borrow a handheld one :3 Well, now that I'm an adult, and noone can prevent me from making "bad financial decisions",

I did some research and ended up getting a used Brother QL-570. I got it used, it's a bit scratched up on the outside but otherwise works flawlessly. The seller also included brand new power and USB-AB cables which is nice.

[TODO: wrapped printer photo]

The Drivers

Being a Linux user, I did my research on the available drivers before buying the printer. The two options I found were a CUPS Driver and a Driverless Python Program/Library (brother_ql).

CUPS

I first tried the CUPS driver. The printer was recognized just fine, adding it to CUPS was as easy as with other printers. But then I tried actually printing something... and the printer spit out a blank label. I didn't bother troubleshooting because my previous experiences with CUPS can be summarized with "as long as you're just printing basic a4 pages you're fine, but if you try to do anything more complicated (i.e. printing 2 pages on one sheet of paper) it will be a clusterfuck".

Initial issues with brother_ql

Next I tried brother_ql. And I got an error. As it turns out, Arch Linux ships a newer version of python-pillow than the program expects. The solution was changing a single word:

--- brother_ql/conversion.py
+++ brother_ql/conversion.py
@@ -109,7 +109,7 @@
                 im = im.resize((im.size[0]//2, im.size[1]))
             if im.size[0] != dots_printable[0]:
                 hsize = int((dots_printable[0] / im.size[0]) * im.size[1])
-                im = im.resize((dots_printable[0], hsize), Image.ANTIALIAS)
+                im = im.resize((dots_printable[0], hsize), Image.LANCZOS)
                 logger.warning('Need to resize the image...')
             if im.size[0] < device_pixel_width:
                 new_im = Image.new(im.mode, (device_pixel_width, im.size[1]), (255,)*len(im.mode))
          

That did the trick, and the program worked!

sudo brother_ql -b linux_kernel -m QL-570 -p file:///dev/usb/lp0 print -l 29 -c Documents/gay\ gay\ homosexual\ gay.png

My intention was to print this label in a different orientation, but surprisingly even this small, the PDF417 barcode was readable. [TODO: photo of the small gay gay homosexual gay label]

With one extra command-line argument, I achieved the result I wanted.

sudo brother_ql -b linux_kernel -m QL-570 -p file:///dev/usb/lp0 print -l 29 -r 90 -c Documents/gay\ gay\ homosexual\ gay.png

[TODO: photo of the big gay gay homosexual gay label]

Figuring out input file resolutions to get pixel-perfect prints

One very cool feature of brother_ql is that it lets you know exactly what resolution does an image need to have to be printed pixel-perfect.

brother_ql info labels

Name      Printable px   Description
12         106           12mm endless
29         306           29mm endless
38         413           38mm endless
50         554           50mm endless
54         590           54mm endless
62         696           62mm endless
62red      696           62mm endless (black/red/white)
102       1164           102mm endless
17x54      165 x  566    17mm x 54mm die-cut
17x87      165 x  956    17mm x 87mm die-cut
23x23      202 x  202    23mm x 23mm die-cut
29x42      306 x  425    29mm x 42mm die-cut
29x90      306 x  991    29mm x 90mm die-cut
39x90      413 x  991    38mm x 90mm die-cut
39x48      425 x  495    39mm x 48mm die-cut
52x29      578 x  271    52mm x 29mm die-cut
62x29      696 x  271    62mm x 29mm die-cut
62x100     696 x 1109    62mm x 100mm die-cut
102x51    1164 x  526    102mm x 51mm die-cut
102x152   1164 x 1660    102mm x 153mm die-cut
d12         94 x   94    12mm round die-cut
d24        236 x  236    24mm round die-cut
d58        618 x  618    58mm round die-cut
          

Now, if you look close enough, say at the 62mm label, and considering [most of] the printers have a resolution of 300DPI, calculate how many pixels it should have, you'll get 62 / 25.4 * 300 = 732.28. Something doesn't check out, brother_ql says there's only 696px!

As it turns out, every label actually has a few milimeters of margin. I imagine this is to account for any misalignment of the paper. If you do the inverse calculation, 696 / 300 * 25.4 = 58.93 you see that there's a bit over 3mm of total margin for the 62mm wide label, which seems to check out with the labels I printed.

[TODO: calculating sizes of stuff] [TODO: brother_ql and perfect pixel sizes] [TODO: brother_ql and specific commands] [TODO: brother_ql and the patch I had to do to make it work on arch] [TODO: inkscape and exporting to 1-bit bw png] [TODO: what I didn't like about the generated scp label] [TODO: https://unascribed.com/junk/intelligent-malicious/] [TODO: what were my goals with my version] https://scp-wiki.wikidot.com/scp-1900 https://scp-wiki.wikidot.com/task-forces#mu-4 https://scp-wiki.wikidot.com/anomaly-classification-system-guide [TODO: source files] [TODO: all the text fields explained in detail] [TODO: all the barcodes explained in detail] [TODO: all the data formats in barcodes explained in detail] [TODO: why VCard over MECARD and why hand-written instead of auto-generated] https://datatracker.ietf.org/doc/html/rfc6350 [TODO: scps 5257 and 3775 are no longer non-existent and in fact 5257 is shit] [TODO: access card label] https://scp-wiki.wikidot.com/security-clearance-levels https://scp-wiki.wikidot.com/component:id-card [TODO: ] [TODO: ] [TODO: ] [TODO: ] [TODO: ] [TODO: ]