Last active
October 6, 2021 13:43
-
-
Save d0n13/7ea53e3cfa6378804c7703e0c39e1094 to your computer and use it in GitHub Desktop.
Convert single pixel AprilTag images to custom bitmap sizes without distortion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# resizse 1 pixel AprilTag to 300x300 without blurring | |
mogrify -path out -filter box -resize 300x300 tag36_11_0* | |
# remove 29 pixels from around the outside if required | |
mogrify -path shaved -shave 29x29 *.png | |
# Run multiple commands over multiple CPUs with 100 operations per thread | |
find . -name "*.png" | xargs -P8 -n100 mogrify -path out -filter box -resize 300x300 | |
# Convert white background in markers to transparent | |
find . -name "*.png" | xargs -P8 -n100 convert {} -transparent White {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to install ImageMagick for these scripts: imagemagick.org