brother_ql_web icon indicating copy to clipboard operation
brother_ql_web copied to clipboard

Feature: Printing red images & Docker support

Open davidramiro opened this issue 3 months ago • 0 comments

Hi, hope it's okay to make a packed PR like this, I can of course also split it up into one for each changeset.

Swapping upstream brother_ql dependency

Since this seems to be the most maintained fork of the original repo, I was curious about future-proofing it a bit more. I would suggest swapping the brother_ql dependency for the more recent and better packaged brother_ql-inventree. This is totally up for debate, as the original repo vom @pklaus was working for me, except for some minor dependency issue with pillow.

Docker support, arg parsing

I added a Dockerfile which keeps things fairly simple. I have noticed the PR #2, although this is now fairly outdated since you changed to Flasks config instead of manual parsing. Some command line args are needed to pass into the docker container, so I reintroduced some of those. The image uses the official python alpine as base and also downloads some fonts.

Red/"redscale" images

Since printing black/white/red images via brother_ql CLI works very well, I was motivated to add this to the frontend. The naming and UX is up for debate, but I've introduced two new color modes, colored and black_and_red. Colored mode is not processing the image at all, best used with images that are already mostly black, white and red. Think warning signs and stuff. Black and red mode is turning the image to greyscale first, and then mapping midtones to red, so you can pass RGB images and have them use the 2 available colors as good as it allows.

I've attached screenshots of both modes to make it a bit more clear.

Colored mode (no processing):

colored

Red & black processing:

red_black

davidramiro avatar Mar 27 '24 18:03 davidramiro