2019-10-25 17:45:23 +00:00
|
|
|
# Stitch
|
|
|
|
|
|
|
|
A program to stitch (overlapping) image tiles of pixel-art to one big image.
|
|
|
|
|
|
|
|
The program will use median filtering for overlapping images.
|
|
|
|
That means that all moving object will completely disappear, and only the static pixels will be outputted.
|
|
|
|
But this has the disadvantage of being slower, and objects that move only a little bit may become blurred.
|
|
|
|
|
|
|
|
You can also use this program to remove moving objects from a series of photographs taken with a tripod.
|
|
|
|
But as this tool is designed for pixel art, it only accepts png as input.
|
|
|
|
|
|
|
|
## Source images
|
|
|
|
|
|
|
|
The source images need to contain their coordinates in the filename, as this program doesn't align the images:
|
|
|
|
|
|
|
|
`%d,%d.png`
|
|
|
|
|
|
|
|
example list of files:
|
|
|
|
|
2022-08-10 18:47:59 +00:00
|
|
|
``` Text
|
2019-10-25 17:45:23 +00:00
|
|
|
0,0.png
|
|
|
|
512,0.png
|
|
|
|
-512,0.png
|
|
|
|
512,-512.png
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2019-11-05 01:31:19 +00:00
|
|
|
- Either run the program and follow the interactive prompt.
|
|
|
|
- Or run the program with parameters:
|
2019-10-25 17:45:23 +00:00
|
|
|
- `divide int`
|
2022-08-08 21:05:58 +00:00
|
|
|
A downscaling factor. 2 will produce an image with half the side lengths. Defaults to 1.
|
2022-08-11 23:06:22 +00:00
|
|
|
- `tile-limit int`
|
|
|
|
Limits median blending to the n newest tiles by file modification time.
|
|
|
|
If set to 0, all available tiles will be median blended.
|
|
|
|
If set to 1, only the newest tile will be used for any resulting pixel.
|
2019-11-30 17:28:17 +00:00
|
|
|
- `input string`
|
2022-08-08 21:05:58 +00:00
|
|
|
The source path of the image tiles to be stitched. Defaults to "./..//..//output")
|
2022-08-11 09:59:53 +00:00
|
|
|
- `entities string`
|
2022-08-10 18:47:59 +00:00
|
|
|
The path to the `entities.json` file. This contains Noita specific entity data. Defaults to "./../../output/entities.json".
|
2022-08-11 09:59:53 +00:00
|
|
|
- `player-path string`
|
2022-08-10 18:47:59 +00:00
|
|
|
The path to the player-path.json file. This contains the tracked path of the player. Defaults to "./../../output/player-path.json".
|
2019-10-25 17:45:23 +00:00
|
|
|
- `output string`
|
2022-08-08 21:05:58 +00:00
|
|
|
The path and filename of the resulting stitched image. Defaults to "output.png".
|
2019-10-25 17:45:23 +00:00
|
|
|
- `xmax int`
|
|
|
|
Right bound of the output rectangle. This coordinate is not included in the output.
|
|
|
|
- `xmin int`
|
|
|
|
Left bound of the output rectangle. This coordinate is included in the output.
|
|
|
|
- `ymax int`
|
|
|
|
Lower bound of the output rectangle. This coordinate is not included in the output.
|
|
|
|
- `ymin int`
|
|
|
|
Upper bound of the output rectangle. This coordinate is included in the output.
|
|
|
|
|
2019-11-05 01:31:19 +00:00
|
|
|
To output the 100x100 area that is centered at the origin use:
|
2019-10-25 17:45:23 +00:00
|
|
|
|
|
|
|
``` Shell Session
|
2019-11-05 01:31:19 +00:00
|
|
|
./stitch -divide 1 -xmin -50 -xmax 50 -ymin -50 -ymax 50
|
2019-10-25 17:45:23 +00:00
|
|
|
```
|
|
|
|
|
2022-08-11 23:06:22 +00:00
|
|
|
To start the program interactively:
|
2019-10-25 17:45:23 +00:00
|
|
|
|
|
|
|
``` Shell Session
|
2019-11-05 01:31:19 +00:00
|
|
|
./stitch
|
|
|
|
```
|
|
|
|
|
|
|
|
Example output:
|
|
|
|
|
|
|
|
``` Shell Session
|
|
|
|
Enter downscaling factor:1
|
|
|
|
Enter input path:..\..\output
|
|
|
|
2019/11/04 23:53:20 Starting to read tile information at "..\..\output"
|
|
|
|
2019/11/04 23:53:32 Got 20933 tiles
|
|
|
|
2019/11/04 23:53:32 Total size of the possible output space is (-25620,-36540)-(25620,36540)
|
|
|
|
Enter output rectangle (xMin,yMin;xMax,yMax):-25620,-36540;25620,36540
|
|
|
|
Enter output filename and path:output.png
|
|
|
|
2019/11/04 23:53:35 Creating output file "output.png"
|
|
|
|
105 / 571 [--------------->____________________________________________________________________] 18.39% 1 p/s ETA 14m0s
|
2019-10-25 17:45:23 +00:00
|
|
|
```
|