pkcreatect(1)

πŸ’– NAME πŸ’–

okay so bestie, welcome to pkcreatect β€” the program to create and import colour table to GTiff image. that's the whole vibe. she makes colour tables and she makes them pretty πŸ’…


✨ SYNOPSIS ✨

pkcreatect -i input -o output [-ct colortable | -min value -max value]
           [options] [advanced options]

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, pkcreatect is a utility to include a color table to a raster dataset. literally that's her job and she ate πŸ’–

you got two paths, bestie, pick your fighter:

  • define an existing color table (ASCII text file) with the option -ct
  • OR define a minimum (-min) and maximum (-max) value

that's it. that's the whole thing. iconic honestly πŸ‘‘


🌸 OPTIONS 🌸

the core four (well, five) πŸŽ€

  • -i filename, --input filename β€” input image
  • -o filename, --output filename β€” output classification image
  • -ct filename, --ct filename β€” colour table in ASCII format having 5 columns: id R G B ALFA (0: transparent, 255: solid). yes ALFA with an A, that's her name, respect it 🫢
  • -min number, --min number β€” minimum value
  • -max number, --max number β€” maximum value

options ✨

  • -g, --grey β€” grey scale. no colour, just vibes in greyscale 🩢
  • -of format, --oformat format β€” Output image format (see also gdal_translate(1))
  • -co option, --co option β€” Creation option for output file. Multiple options can be specified. stack 'em up bestie πŸ₯ž
  • -d description, --description description β€” Set image description
  • -v, --verbose β€” verbose. she will tell you EVERYTHING and honestly? we love a chatty queen πŸ—£οΈ

Advanced options πŸ‘‘

  • -l filename, --filename filename β€” Create legend as png file
  • -dim cols -dim rows, --dim cols --dim rows β€” number of columns and rows in legend

πŸ’œ EXAMPLE πŸ’œ

Attach a color table to image with values between 0 and 50

pkcreatect -i image.tif -o image_ct.tif -min 0 -max 50

Attach a grey scale "color" table to image with values between 0 and 100 and create a legend image (annotation needs to be drawn manually)

pkcreatect -i image.tif -o image_ct.tif -min 0 -max 100 -l legend.tif -g
heads up: the annotation needs to be drawn manually, so don't come for her when the legend has no labels, she did her part 😭

Attach a predefined color table to image.tif. The colortable has 5 entries for the values 0 (black), 1 (red), 2 (green), 3 (blue) and 4 (grey)

cat colortable.txt
0 0 0 0 255
1 255 0 0 255
2 0 255 0 255
3 0 0 255 255
4 100 100 100 255
pkcreatect -i image.tif -o image_ct.tif -ct colortable.txt

Remove the color table from an image

pkcreatect -i image.tif -o image_noct.tif -ct none

and that's the whole page bestie, no cap, every flag accounted for 🌈

this one's from the pkcreatect(1) manual, dated 01 January 2025 β€” mwah, go make something cute πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from