Skip to content

Latest commit

 

History

History
41 lines (23 loc) · 1.55 KB

README.md

File metadata and controls

41 lines (23 loc) · 1.55 KB

Script to enhance the priority for the PlaceNL Templates

This script increases the priority of all edge pixels in the canvas.

This is to make sure the autoplacers place any outlines first before filling in any of the other spaces. The larger areas with the same color can then be filled by non autoplacer users.

The priority is determined by calculting prio = red << 16 | green << 8 | blue

The priority of all edge pixels is then increased by 10.000, which is the randomness value that gets added by the UserScript from PlaceNL

It can also lower the priority in a checkboard pattern (thanks ArcticDolphin in Discord for the idea) This will lower half the pixels priority value by 10.000

Usage

Install depedencies (Pillow) python -m pip install -r requirements.txt

python enhanceprio.py <templatefile_path> <priofile_path> [-o output_file] [-l]

To generate the enhanced map use:

python enhanceprio.py image.png prio.png -o enhanced_prio.png

To generate the enhanced map with lowered checkerboard pattern use:

python enhanceprio.py image.png prio.png -o enhanced_prio.png -l

To only show the image, and not store it, you can exlude the output variable:

python enhanceprio.py image.png prio.png -l

Example

When using the examle above, with this template template image

And this priority map Priority map

It will generate the following enhanced priority map Enhanced Priority map