Created some scripts to help with processing .pgm files, which are simple intensity grayscale files, often the output of a special sensor, such as an IR camera. The scripts can be found here: https://github.com/delrocco/pgmhelper
original/cups.pgm | scaled/cups.pgm | visible/cups.png | colored/cups.png |
processpgm.sh | wraps the scripts below for a .pgm -> color image conversion |
pgmhelper.py | various functionality for working with .pgm files |
visualize.sh | invokes ImageMagick to convert and scale .pgm images |
colorize.sh | invokes ImageMagick with CLUT to color an image |
Process all .pgms in the specified folder:
processpgm.sh ~/images/ png 800x600
List minimum and maximum intensity values of a folder of .pgm files:
pgmhelper.py ~/images/ -r 73-1815
Find “bad” .pgm files; files with intensity values outside range [1-65536]:
pgmhelper.py ~/images/ -b pgmhelper.py ~/images/ -b | xargs rm
Visualize .pgm files (requires ImageMagick):
visualize.sh ~/images/ ~/visible/ jpg 1024x768
False-color grayscale files with CLUT (requires ImageMagick):
colorize.sh ~/visible/ ~/colored/