Extractors - OptrixAU/printathome-python GitHub Wiki

Extractors allow you to extract individual cards out of multi-page images.

You can create an extractor with a vector image editing program, such as Adobe Illustrator (paid) or Inkscape (free), or you can construct one in a text editor.

The extractor defines a set of RECT (rectangle) regions that are used to cut out cards.

Building in an Image Editor

  1. Create a new image in your editor with the same dimensions as your source images.
  2. Paste in your source image
  3. On a new layer, draw rectangles on top of each of your cards. Use white rectangles for card fronts, and pure black rectangles (#000000) for backs.
  4. Delete the source image layer
  5. Save as 'extractor.svg'. Ensure you use presentation attributes, not styles.

Building in a Text Editor

Copy the following file to extractor.svg

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1656px" height="2342px" viewBox="0 0 1656 2342" enable-background="new 0 0 1656 2342" xml:space="preserve">
    <rect x="46.48" y="48.24" opacity="0.5" fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" width="240.53" height="341.8"/>
</svg>

You can copy the 'rect' section as many times as you need, adjusting the 'x', 'y', 'width' and 'height' as needed (although you can change width and height, its best if all of your widths and heights within a file are the same).

Backs

In most cases, your card backs won't be in quite the same order as your fronts, because they are mirrored across the X axis (ie. the card on the left of your front image has the back from the right of your back image). In these cases, you'll need to make two extraction images.

Create a file named extractor[back].svg. This is normally a copy of your normal extractor.svg file, but with the order of the rect elements changed around.

⚠️ **GitHub.com Fallback** ⚠️