dcmquant(1)

πŸ’… dcmquant β€” like, the OFFIS DCMTK tool for making your color images palette color πŸ’…

okay so bestie, welcome to dcmquant(1) β€” yes that's the manual page name, iykyk β€” and honestly? this little icon is about to take your DICOM color image and give it a whole new palette-color vibe. 🎨✨

✨ NAME ✨

dcmquant β€” converts DICOM color images into palette color, no cap πŸ’–

🌸 SYNOPSIS 🌸

dcmquant [options] dcmfile-in dcmfile-out

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: the dcmquant utility reads a DICOM color image, computes a palette color look-up table of whatever size you want for that image (it's based on the median cut algorithm published by Paul Heckbert, iconic behavior honestly), and then converts that color image into a DICOM palette color image. slay. πŸ’…

πŸŽ€ PARAMETERS πŸŽ€

  • dcmfile-in β€” the DICOM input filename you want converted (literally just - if you want stdin, we love a flexible queen)
  • dcmfile-out β€” the DICOM output filename to be written (- for stdout, periodt)

πŸ‘‘ OPTIONS πŸ‘‘

🌈 general options

  • -h, --help β€” prints this help text and then dips, bye ✨
  • --version β€” prints version info and exits, short and sweet
  • --arguments β€” prints the expanded command line arguments, so you can see what actually went down
  • -q, --quiet β€” quiet mode, prints no warnings and no errors, shhh 🀫
  • -v, --verbose β€” verbose mode, prints processing details, she's chatty and we respect it
  • -d, --debug β€” debug mode, prints debug information, for when you need the full lore πŸ”
  • -ll, --log-level [l]evel: string constant β€” uses level l for the logger. the levels are: fatal, error, warn, info, debug, trace
  • -lc, --log-config [f]ilename: string β€” uses config file f for the logger πŸ—‚οΈ

🧚 input options

input file format:

  • +f, --read-file β€” reads file format or data set (this is the default, bestie)
  • +fo, --read-file-only β€” reads file format only, strictly that
  • -f, --read-dataset β€” reads data set without file meta information

input transfer syntax:

  • -t=, --read-xfer-auto β€” uses TS recognition (default, automatic queen)
  • -td, --read-xfer-detect β€” ignores the TS specified in the file meta header, rude but ok
  • -te, --read-xfer-little β€” reads with explicit VR little endian TS
  • -tb, --read-xfer-big β€” reads with explicit VR big endian TS
  • -ti, --read-xfer-implicit β€” reads with implicit VR little endian TS

πŸ“ image processing and encoding options

frame selection:

  • +F, --frame [n]umber: integer β€” selects the specified frame
  • +Fa, --all-frames β€” selects all frames (default, she's an overachiever ✨)

compatibility:

  • +Mp, --accept-palettes β€” accepts incorrect palette attribute tags (0028,111x) and (0028,121x). we're being nice about it πŸ™ˆ

median cut dimension selection:

  • +Dr, --mc-dimension-rgb β€” max dimension from RGB range (default)
  • +Dl, --mc-dimension-lum β€” max dimension from luminance

median cut representative color selection:

  • +Cb, --mc-color-avgbox β€” averages colors in the box (default)
  • +Cp, --mc-color-avgpixel β€” averages pixels in the box
  • +Cc, --mc-color-center β€” selects the center of the box, main character energy 🎯

color palette value representation:

  • +pw, --write-ow β€” writes Palette LUT as OW (default)
  • +pu, --write-us β€” writes Palette LUT as US (retired, she's a legacy icon, but retired)

color palette creation:

  • +pe, --lut-entries-word β€” writes Palette LUT with 16-bit entries
  • +pf, --floyd-steinberg β€” uses Floyd-Steinberg error diffusion, fancy πŸ’«
  • +pc, --colors number of colors: 2..65536 (default 256) β€” the number of colors to quantize to
  • +pc β€” number of colors to quantize to (same flag, same tea, listing it like the original does 🫢)

SOP Class UID:

  • +cd, --class-default β€” keeps the SOP Class UID (default)
  • +cs, --class-sc β€” converts to Secondary Capture Image (this implies --uid-always)

SOP Instance UID:

  • +ua, --uid-always β€” always assigns a new UID (default)
  • +un, --uid-never β€” never assigns a new UID, she said no thanks

πŸ’œ output options

output file format:

  • +F, --write-file β€” writes file format (default)
  • -F, --write-dataset β€” writes data set without file meta information

output transfer syntax:

  • +t=, --write-xfer-same β€” writes with the same TS as input (default)
  • +te, --write-xfer-little β€” writes with explicit VR little endian TS
  • +tb, --write-xfer-big β€” writes with explicit VR big endian TS
  • +ti, --write-xfer-implicit β€” writes with implicit VR little endian TS

post-1993 value representations:

  • +u, --enable-new-vr β€” enables support for new VRs (UN/UT) (default)
  • -u, --disable-new-vr β€” disables support for new VRs and converts to OB

group length encoding:

  • +g=, --group-length-recalc β€” recalculates group lengths if present (default)
  • +g, --group-length-create β€” always writes with group length elements
  • -g, --group-length-remove β€” always writes without group length elements

length encoding in sequences and items:

  • +e, --length-explicit β€” writes with explicit lengths (default)
  • -e, --length-undefined β€” writes with undefined lengths

data set trailing padding (not with --write-dataset):

  • -p=, --padding-retain β€” does not change padding (default if not --write-dataset)
  • -p, --padding-off β€” no padding (implicit if --write-dataset)
  • +p, --padding-create [f]ile-pad [i]tem-pad: integer β€” aligns the file on a multiple of f bytes and items on a multiple of i bytes πŸ“
heads up bestie: that trailing padding section is explicitly not for --write-dataset, so don't come for me if it doesn't apply πŸ’€

πŸ”₯ LOGGING πŸ”₯

okay so the level of logging output of the various command line tools and underlying libraries can be specified by you, the user. by default, only errors and warnings are written to the standard error stream. using option --verbose also reports informational messages like processing details. option --debug can be used to get more details on the internal activity, e.g. for debugging purposes. other logging levels can be selected using option --log-level. in --quiet mode only fatal errors are reported. in such very severe error events, the application will usually terminate 😭. for more details on the different logging levels, see the documentation of module "oflog".

in case the logging output should be written to file (optionally with logfile rotation), to syslog (Unix) or the event log (Windows) option --log-config can be used. this configuration file also allows for directing only certain messages to a particular output stream and for filtering certain messages based on the module or application where they are generated. an example configuration file is provided in <etcdir>/logger.cfg πŸ—‚οΈβœ¨

⭐ COMMAND LINE ⭐

all command line tools use the following notation for parameters: square brackets enclose optional values (0-1), three trailing dots indicate that multiple values are allowed (1-n), and a combination of both means 0 to n values. iykyk πŸ“š

command line options are distinguished from parameters by a leading '+' or '-' sign, respectively. usually, order and position of command line options are arbitrary (i.e. they can appear anywhere). however, if options are mutually exclusive the rightmost appearance is used. this behavior conforms to the standard evaluation rules of common Unix shells. periodt. πŸ’…

in addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e.g. @command.txt). such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator unless they appear between two quotation marks) prior to any further evaluation. please note that a command file cannot contain another command file β€” no inception, bestie πŸŒ€. this simple but effective approach allows one to summarize common combinations of options/parameters and avoids longish and confusing command lines (an example is provided in file <datadir>/dumppat.txt).

🌈 ENVIRONMENT 🌈

the dcmquant utility will attempt to load DICOM data dictionaries specified in the DCMDICTPATH environment variable. by default, i.e. if the DCMDICTPATH environment variable is not set, the file <datadir>/dicom.dic will be loaded unless the dictionary is built into the application (default for Windows).

the default behavior should be preferred and the DCMDICTPATH environment variable only used when alternative data dictionaries are required. the DCMDICTPATH environment variable has the same format as the Unix shell PATH variable in that a colon (":") separates entries. on Windows systems, a semicolon (";") is used as a separator. the data dictionary code will attempt to load each file specified in the DCMDICTPATH environment variable. it is an error if no data dictionary can be loaded 🚨

Copyright (C) 2001-2026 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.


aaaand that's the whole page, bestie 🫢✨ official vibes: Version 3.7.1, stamped Sat Oct 17 2026 09:34:01 β€” she's giving OFFIS DCMTK, she's giving iconic, she's giving palette color. go convert something gorgeous πŸ’…πŸŽ€

πŸ“¦ where this page comes from