User:Thijshijsijsjss/Pen Plotting Panache/Plothatching Workflow: Difference between revisions

From XPUB & Lens-Based wiki
(Add notes on transparancy adjustments)
(Add bitmap tracing steps)
Line 63: Line 63:


==Inkscape==
==Inkscape==
===Prepare document===
Setting up document to A3 paper
create layers (res,c,y,m,k)
===Steps for each color channel image===
We will now do some preparations for each color we'll be plotting with. Confusingly, there are two notions of 'layer' here: the Inkscape 'layers', which can be thought of as folders that contain all the paths that sould be drawn with one pen. Then, there are the 'layers' of the physical world: layers of the same color that will be drawn on top of each other.
# Select the res layer
# Import all crosshatched layers of one color channel to the res folder. This is easiest by selecting them all in a file explorer and dragging them ONTO THE CANVAS AREA (note that Inkscape will crash when they are dragged onto the layers menu), but this can also be done one by one through Inkscape's import menu.
# For each imported object, you'll see a sublayer in Inkscape with an image. For each of these sublayers:
## Position it at (0,0) by selecting the Select Tool, selecting the relevant sublayer, and setting x and y fields to 0.
## Still with the Select Tool, select the image in the sublayer, and go to Trace Bitmap (Shift+Alt+B, Path>Trace Bitmap, or through the quick menu if it's still open)
## MAKE SURE SMOOTH CORNERS IS TICKED OFF
## Click Apply
# Move all paths that have been created to the appropriate Inkscape layer.
# Delete all contents from the res layer.


==Plotting==
==Plotting==

Revision as of 17:49, 13 January 2024

A documentation of my workflow for making multicolor crosshatching plots. It should (ultimately) be comprehensive for anyone by links and step-by-step guides, but is for now primarily written for my own future reference. This means that there will be many options for each of these steps, and I will limit myself to those strategies I have found to work for me.

I will make reference to several pieces of software. Notably:

Image selection

Image preparation

Dimensions

Examples of plots of 500px and 600px in width
Example of 500px (bottom) and 600px (top) plot widths
Example of a plot of 1000px in width
Example of a plot of 1000px plot in width

To avoid having to scale many layers individually later on, it's easiest to determine the size of your plot at the start. As the plotter is fastest in its horizontal axis, it is advised to orient your image in a way so that the largest dimension is the horizontal one (i.e. by rotating a portrait mode image). However, when wanting to make a plot as large as possible, this is obviously not always desired. In that case, keep bounds of 1100px by 1450px in mind (the full size of the paper in pixels according to Inkscape's default conversion).

My three most used choices for image width are:

  • 500px: This allows for two same width plots to be placed next to eachother on the width of the A3 plotter I have been using.
  • 600px: 500px plots feel quite small. I have found 600px to be the sweet spot for compact plots that still capture quite some detail.
  • 1000px: this is the about the full width of the A3 plotter I have been using.

Note that this conversion between pixels and real world measurements units is actually arbitrary. This discussion has the Inkscape default conversion in mind. Relying on this conversion saves us potentially difficult conversion problems later on, and has proven reliable between plots.

Passe Partout

Eventually, we'll need to create vector paths out of the images the crosshatching software outputs. As plotting is a lenghty step, any preparations we can do to improve the plotting time, will reduce the overall time it takes to create a plothatched image. One such improvement is the way the vector paths are traced. In Inkscape, 'Centerline (autotrace)' has the best results, by far. However, it will often (~60% of the time) crash Inkscape, in which case one has to resort to less efficient tracing methods that will typicially cause each line to be drawn from it's center (effectively adding >50% extra plotting time).

By adding a white border, a 'passe partout', around your image, Centerline (autotrace) has a better chance to succeed. In fact, borders of 100px have had a 100% success rate for me (n>150). This will NOT affect the final dimensions of your plot.

  1. Open your file in Krita
  2. Go to Image > Resize Canvas
  3. Add 100px to the smallest of your image's dimenstions
  4. Click OK
  5. Save image (overwrite it)

Layer separation

We will separate the different color channels and save them as individual files, so that we will be able to plothatch them individually.

  1. Open your file in Krita
  2. Change color space to CMYK
    1. Image > Convert Image Color Space
    2. Choose Model: CMYK / Alpha
    3. Click OK
  3. Separate image
    1. Image > Separate Image
    2. Click OK
  4. Invert all layers. For each of the layers:
    1. Go to a layer and press ctr+I
  5. Save layers 'cyan', 'yellow', 'magenta' and 'black' separately. For each of the layers:
    1. Toggle visibility for only one of these layers
    2. Save (ctr+shft+S)
  6. Fix opacity. For each of the new images:
    1. Open the image with the Windows default images app
    2. Three dots > Change image size
    3. Save image (overwrite it)

Transparancy adjustments

The previous step will typically output jpg images for which the transparancy is interpreted as black. Often this is not what we want. Magically, opening an image in Windows's default image viewer and re-saving it (overwriting it) fixes the transparancy. This is a quick process. For other operating systems, I imagine Krita and Inkscape both support functionality to handle this.

Hatching

Setting parameters

Hatching each layer

Inkscape

Prepare document

Setting up document to A3 paper create layers (res,c,y,m,k)

Steps for each color channel image

We will now do some preparations for each color we'll be plotting with. Confusingly, there are two notions of 'layer' here: the Inkscape 'layers', which can be thought of as folders that contain all the paths that sould be drawn with one pen. Then, there are the 'layers' of the physical world: layers of the same color that will be drawn on top of each other.

  1. Select the res layer
  2. Import all crosshatched layers of one color channel to the res folder. This is easiest by selecting them all in a file explorer and dragging them ONTO THE CANVAS AREA (note that Inkscape will crash when they are dragged onto the layers menu), but this can also be done one by one through Inkscape's import menu.
  3. For each imported object, you'll see a sublayer in Inkscape with an image. For each of these sublayers:
    1. Position it at (0,0) by selecting the Select Tool, selecting the relevant sublayer, and setting x and y fields to 0.
    2. Still with the Select Tool, select the image in the sublayer, and go to Trace Bitmap (Shift+Alt+B, Path>Trace Bitmap, or through the quick menu if it's still open)
    3. MAKE SURE SMOOTH CORNERS IS TICKED OFF
    4. Click Apply
  4. Move all paths that have been created to the appropriate Inkscape layer.
  5. Delete all contents from the res layer.

Plotting