Repo re-org, update README

This commit is contained in:
jaseg 2024-04-21 19:17:51 +02:00
parent 965001f897
commit 2af2479196
7 changed files with 47 additions and 42 deletions

View file

@ -1,36 +1,41 @@
Bruder: Print pictures as collages with label tape printers taep: Print pictures as collages with label tape printers
=========================================================== ===========================================================
``bruder`` is a tool that helps you create collages out of label tape printed with a label printer such as Brother's .. figure:: readme_flow.png
:width: 800px
The `taep` workflow from artwork to a physical T-shirt using iron-on label tape. Cat photo by `Jae Park <https://unsplash.com/photos/brown-tabby-cat-7GX5aICb5i4>`__.
``taep`` is a tool that helps you create collages out of label tape printed with a label printer such as Brother's
P-touch devices. P-touch devices.
``bruder dither`` takes an SVG file with your design and some lines representing the labels' locations, and ``taep dither`` takes an SVG file with your design and some lines representing the labels' locations, and
outputs a list of dithered PNG files, one for each label, ready for printing. Optionally, ``bruder print`` can also directly outputs a list of dithered PNG files, one for each label, ready for printing. Optionally, ``taep print`` can also directly
print these rendered images for you using the ``ptouch-print`` tool. print these rendered images for you using the ``ptouch-print`` tool.
For creating and tweaking your design, ``bruder`` has several helper utilities built-in. ``bruder template`` will generate a For creating and tweaking your design, ``taep`` has several helper utilities built-in. ``taep template`` will generate a
template with a label tape layout you give it that you can use to base your design off of. ``bruder preview`` will render template with a label tape layout you give it that you can use to base your design off of. ``taep preview`` will render
a preview that approximates how the printed labels will look when you lay them out. ``bruder assembly`` will render an a preview that approximates how the printed labels will look when you lay them out. ``taep assembly`` will render an
assembly diagram with labels indicating each label tape's number in the order output by ``bruder dither`` or `bruder assembly diagram with labels indicating each label tape's number in the order output by ``taep dither`` or `taep
print`. print`.
Quick start Quick start
----------- -----------
1. Install ``bruder`` from PyPI using `pip install bruder`, and install ``usvg``, ``resvg``, ``didder`` and ``ptouch-print`` as 1. Install ``taep`` from PyPI using `pip install taep`, and install ``usvg``, ``resvg``, ``didder`` and ``ptouch-print`` as
shown below under Dependencies_. shown below under Dependencies_.
2. Run ``bruder template template.svg`` to create a template with pre-generated label tape areas. The default tape width 2. Run ``taep template template.svg`` to create a template with pre-generated label tape areas. The default tape width
is 24mm, but you can adjust this as you wish. is 24mm, but you can adjust this as you wish.
3. Create a new SVG document and design your artwork in it. 3. Create a new SVG document and design your artwork in it.
4. Copy the label tape areas from the template into your artwork SVG and save the resulting SVG. ``bruder`` will later 4. Copy the label tape areas from the template into your artwork SVG and save the resulting SVG. ``taep`` will later
identify these areas by their color. You can copy or delete these, change the length of them, and move and rotate identify these areas by their color. You can copy or delete these, change the length of them, and move and rotate
them as you wish. Just make sure you don't skew or shear them and that you don't change their width so that they them as you wish. Just make sure you don't skew or shear them and that you don't change their width so that they
still match the width of the tape that's physically in the printer you're using. still match the width of the tape that's physically in the printer you're using.
5. Run ``bruder preview artwork_with_label_areas.svg`` on this SVG to render a preview image. By default, ``bruder`` will 5. Run ``taep preview artwork_with_label_areas.svg`` on this SVG to render a preview image. By default, ``taep`` will
open this preview image in your browser. If that doesn't work, run ``bruder preview [input].svg preview_out.svg`` to open this preview image in your browser. If that doesn't work, run ``taep preview [input].svg preview_out.svg`` to
write it to `preview_out.svg` and open that file with an SVG viewer of your choice. Adjust the content of your design write it to `preview_out.svg` and open that file with an SVG viewer of your choice. Adjust the content of your design
as necessary. as necessary.
6. Run ``bruder print artwork_with_label_areas.svg`` to print your artwork to a brother P-touch label printer connected 6. Run ``taep print artwork_with_label_areas.svg`` to print your artwork to a brother P-touch label printer connected
via USB. via USB.
Dependencies Dependencies
@ -39,29 +44,29 @@ Dependencies
usvg usvg
``usvg`` can be installed using ``cargo install usvg``. ``usvg`` can be installed using ``cargo install usvg``.
``usvg`` is used by ``bruder`` to simplify the input SVG file before processing it. ``usvg`` is used by ``taep`` to simplify the input SVG file before processing it.
resvg resvg
``resvg`` can be installed using ``cargo install resvg``. ``resvg`` can be installed using ``cargo install resvg``.
``bruder`` uses ``resvg`` to rasterize the SVG file. ``taep`` uses ``resvg`` to rasterize the SVG file.
didder didder
``didder`` can be installed from source at `https://github.com/makew0rld/didder <https://github.com/makew0rld/didder>`__. ``didder`` can be installed from source at `https://github.com/makew0rld/didder <https://github.com/makew0rld/didder>`__.
``bruder`` uses ``didder`` to dither the rasterized input, because these thermal label printers can only print two ``taep`` uses ``didder`` to dither the rasterized input, because these thermal label printers can only print two
colors and do not support grayscale. colors and do not support grayscale.
ptouch-print (optional) ptouch-print (optional)
``ptouch-print`` can be installed from source at `https://git.familie-radermacher.ch/linux/ptouch-print.git <https://git.familie-radermacher.ch/linux/ptouch-print.git>`__. ``ptouch-print`` can be installed from source at `https://git.familie-radermacher.ch/linux/ptouch-print.git <https://git.familie-radermacher.ch/linux/ptouch-print.git>`__.
``bruder`` uses ``ptouch-print`` when you ask it to print the generated labels using ``bruder print``. You can also use ``taep`` uses ``ptouch-print`` when you ask it to print the generated labels using ``taep print``. You can also use
``bruder dither`` to just generate a pile of PNGs, and use something else to print them. ``taep dither`` to just generate a pile of PNGs, and use something else to print them.
Command-Line Interface Usage Command-Line Interface Usage
---------------------------- ----------------------------
You can override where ``bruder`` looks for ``usvg``, ``resvg``, ``didder`` and ``ptouch-print`` by passing the full path to a You can override where ``taep`` looks for ``usvg``, ``resvg``, ``didder`` and ``ptouch-print`` by passing the full path to a
binary through the environment variables ``USVG``, ``RESVG``, ``DIDDER`` and ``PTOUCH_PRINT``. binary through the environment variables ``USVG``, ``RESVG``, ``DIDDER`` and ``PTOUCH_PRINT``.
You can override didder's dithering settings by passing the environment variable `DIDDER_ARGS`. The default value used You can override didder's dithering settings by passing the environment variable `DIDDER_ARGS`. The default value used
@ -69,8 +74,8 @@ when this variable is not set is `edm --serpentine FloydSteinberg`.
.. code-block:: shell .. code-block:: shell
bigdata~/p/bruder <3 python -m bruder --help bigdata~/p/taep <3 python -m taep --help
Usage: python -m bruder [OPTIONS] COMMAND [ARGS]... Usage: python -m taep [OPTIONS] COMMAND [ARGS]...
Options: Options:
--help Show this message and exit. --help Show this message and exit.
@ -82,13 +87,13 @@ when this variable is not set is `edm --serpentine FloydSteinberg`.
print print
template template
``bruder template`` ``taep template``
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
.. code-block:: shell .. code-block:: shell
bigdata~/p/bruder <3 python -m bruder template --help bigdata~/p/taep <3 python -m taep template --help
Usage: python -m bruder template [OPTIONS] [OUTPUT_SVG] Usage: python -m taep template [OPTIONS] [OUTPUT_SVG]
Options: Options:
--num-rows INTEGER Number of tapes --num-rows INTEGER Number of tapes
@ -99,13 +104,13 @@ when this variable is not set is `edm --serpentine FloydSteinberg`.
--magic-color TEXT SVG color of tape --magic-color TEXT SVG color of tape
--help Show this message and exit. --help Show this message and exit.
``bruder preview`` ``taep preview``
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
.. code-block:: shell .. code-block:: shell
bigdata~/p/bruder <3 python -m bruder preview --help bigdata~/p/taep <3 python -m taep preview --help
Usage: python -m bruder preview [OPTIONS] [INPUT_SVG] [OUTPUT_SVG] Usage: python -m taep preview [OPTIONS] [INPUT_SVG] [OUTPUT_SVG]
Options: Options:
--magic-color TEXT SVG color of tape --magic-color TEXT SVG color of tape
@ -113,13 +118,13 @@ when this variable is not set is `edm --serpentine FloydSteinberg`.
--pixel-height INTEGER Printer tape vertical pixel height --pixel-height INTEGER Printer tape vertical pixel height
--help Show this message and exit. --help Show this message and exit.
``bruder dither`` ``taep dither``
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
.. code-block:: shell .. code-block:: shell
bigdata~/p/bruder <3 python -m bruder dither --help bigdata~/p/taep <3 python -m taep dither --help
Usage: python -m bruder dither [OPTIONS] [INPUT_SVG] OUTPUT_DIR Usage: python -m taep dither [OPTIONS] [INPUT_SVG] OUTPUT_DIR
Options: Options:
--magic-color TEXT SVG color of tape --magic-color TEXT SVG color of tape
@ -127,13 +132,13 @@ when this variable is not set is `edm --serpentine FloydSteinberg`.
--pixel-height INTEGER Printer tape vertical pixel height --pixel-height INTEGER Printer tape vertical pixel height
--help Show this message and exit. --help Show this message and exit.
``bruder print`` ``taep print``
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
.. code-block:: shell .. code-block:: shell
bigdata~/p/bruder <3 python -m bruder print --help bigdata~/p/taep <3 python -m taep print --help
Usage: python -m bruder print [OPTIONS] [INPUT_SVG] Usage: python -m taep print [OPTIONS] [INPUT_SVG]
Options: Options:
--magic-color TEXT SVG color of tape --magic-color TEXT SVG color of tape
@ -146,13 +151,13 @@ when this variable is not set is `edm --serpentine FloydSteinberg`.
included. included.
--help Show this message and exit. --help Show this message and exit.
``bruder assembly`` ``taep assembly``
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
.. code-block:: shell .. code-block:: shell
bigdata~/p/bruder <3 python -m bruder assembly --help bigdata~/p/taep <3 python -m taep assembly --help
Usage: python -m bruder assembly [OPTIONS] [INPUT_SVG] [OUTPUT_SVG] Usage: python -m taep assembly [OPTIONS] [INPUT_SVG] [OUTPUT_SVG]
Options: Options:
--magic-color TEXT SVG color of tape --magic-color TEXT SVG color of tape

View file

@ -1,2 +0,0 @@
import bruder
bruder.cli()

View file

@ -3,10 +3,10 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[tool.setuptools] [tool.setuptools]
py-modules = ['bruder'] py-modules = ['taep']
[project] [project]
name = "bruder" name = "taep"
version = "v1.0.0-rc1" version = "v1.0.0-rc1"
description = "Print pictures as collages using label tape printers" description = "Print pictures as collages using label tape printers"
readme = "README.rst" readme = "README.rst"
@ -36,5 +36,5 @@ classifiers = [
] ]
[project.urls] [project.urls]
homepage = "https://github.com/jaseg/bruder" homepage = "https://github.com/jaseg/taep"

BIN
readme_flow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

2
taep/__main__.py Normal file
View file

@ -0,0 +1,2 @@
import taep
taep.cli()