with pillow < 3.3.0, the call of Image.new()
in brother_ql/brother_ql_create.py line 113
would fail with the following error:
[...]
File "/usr/lib/python3.4/site-packages/brother_ql/brother_ql_create.py", line 113, in create_label
new_im = Image.new(im.mode, (device_pixel_width, im.size[1]), (255,)*len(im.mode))
File "/usr/lib64/python3.4/site-packages/PIL/Image.py", line 2050, in new
return Image()._new(core.fill(mode, size, color))
TypeError: an integer is required (got type tuple)
This seems to work fine on the QL-800, thanks! I've added a tick against
it.
I've also slightly updated the help for `brother_ql_create` to make it
clear that you have to enable the --red option to print on tape which
supports red, otherwise the printer reports an error.
(This happens with the P-Touch software too and it's really unclear what
you're doing wrong.)
create_label() is the most important function to be used (imported)
by other Python scripts and packages. It shouldn't force its calling
code or program to terminate in case of invalid input.
The dissection of the color into red, black, & white now
takes part in the HSV color space (instead of HLS before).
Pillow's built-in capabilities to convert RGB → HSV
are now used.
While the creation of --red labels still takes 16 times longer
than the simple black/white ones, it is now 90% less time than
before this commit.
* create_label() now accepts a new keyword argument compress.
The default is False → no compression if not set manually.
This will speed-up the label creation in many cases
at the expense of larger file sizes. Set to True if you
don't care about processing time but want to store the
generated label files.
* The brother_ql_create CLI offers this via the new
argument --compress.
New default (if not set): no compression.
The advantage is that the conversion to grayscale is now done
in the same way for all labels just before the conversion
to b/w.
The memory footprint shouln't increase too much.
And profiling showed that the the performance for small labels
that need pasting didn't deteriorate.