You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+38-2
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,50 @@ This tool is aimed at people crafting with thread, in the more literal sense of
5
5
I've often stumbled upon the problem that I wanted to knit a pattern that had not yet been converted into an actual two-color stitch pattern, or that the gauge for my material wouldn't fit the pattern's aspect ratio.
6
6
To solve the problem, I started painting over digital images, hoping the gauge would hold. I succeeded eventually, but one pattern could take up to five hours.
7
7
8
+
## Installation
9
+
10
+
### Requirements
11
+
Disclaimer: I have not made any experiments wrt backwards compatibility yet.
12
+
#### OpenCV
13
+
This project requires [OpenCV](https://opencv.org/releases/) to be built. I'm working with version 4.2.
14
+
The opencv root folder must be part of your CMAKE_MODULE_PATH.
15
+
#### CMake
16
+
Configuration of this project requires [CMake](https://cmake.org/download/) to be installed. I'm using 3.15.2. You need CTest if you wish to build the unit tests.
17
+
#### Qt5
18
+
Building the program such that it has a GUI mode requires a [Qt SDK](https://www.qt.io/download) to be installed. I'm using 5.14.2.
19
+
The libqt5 root folder must be part of your CMAKE_MODULE_PATH. You need at least the packages Core, Gui, Network, QmlModes, Qml, QuickCompiler and Quick.
20
+
#### Doctest
21
+
Testing requires [doctest](https://github.com/onqtam/doctest) on your machine. Only for running the program, it is not necessary.
22
+
Doctest is header only, so it doesn't technically get installed. To use it with this program, provide the config entry DOCTEST_INCLUDE_DIR as the path to your doctest copy (root directory) when configuring the project in CMake.
23
+
8
24
## Automatic generation
9
25
10
26
### Input Data
11
27
The input image must be of JPG or PNG format. Note that for proper pixelation, you need to know the gauge and colors of your yarn and the desired size of the workpiece.
12
28
13
-
### Recomputation
29
+
### Shell Mode
14
30
From the gauge and result size, the amount and dimensions of one "stixel" (stitch-sized pixel) can directly be computed.
15
31
The algorithm will then determine the overall color of that stixel in original colors, then figure out which of the yarn colors comes closest.
32
+
In shell mode, you can only specify where to crop the image if its aspect ratio doesn't match your output. Your choice is one of:
33
+
* TOP_LEFT
34
+
* TOP
35
+
* TOP_RIGHT
36
+
* LEFT
37
+
* CENTER
38
+
* RIGHT
39
+
* BOTTOM_LEFT
40
+
* BOTTOM
41
+
* BOTTOM_RIGHT
42
+
16
43
The output image will be a cropped version of the original one, set as stixels of the aspect ratio computed earlier and of the color determined in the previous step.
17
44
18
-
Note that for successful computation, you must specify an output path. The input file is not overwritten unless you explicitly define its path as the output file.
45
+
Note that for successful computation, you must specify an output path. The input file is not overwritten unless you explicitly define its path as the output file.
46
+
47
+
### GUI Mode
48
+
Select the input file from the File menu using "Load...". If successful, the image will show in the input window, and a first preview will be calculated.
49
+
Use the text input fields to determine gauge size and desired output size of your workpiece. The preview will adapt.
50
+
You can select a ROI from the input image. The aspect ratio is fixed to the one you specified as desired result size. You are not allowed to exceed input image range.
51
+
By default, you have two result stitch colors in the list. Using the Change button, you can select different output colors that match your yarn. The Add button allows you to add up to four colors. The Remove button allows you to reduce it back to at least two.
52
+
The stitches are separated by helper lines (complete with a highlight color to help you count). If the colors don't work well with your yarn colors, you can adapt them in the same way. You can also disable helper grids using the check box at the top.
53
+
The preview will adjust each time you change properties. When you're done, Select "Save as..." from the File menu.
54
+
You can exit the program through the X knob on the program window, or through the "Quit" command from the File menu.
0 commit comments