lss16toppm
Convert LSS16 image files to PPM
SYNOPSIS
lss16toppm [-width <width>] [-height <height>] [-scale <scale>] [-maxval <maxval>] [-minval <minval>] [-auto] [-colorspec <channel>] [-x] [-y] [-z] [-alpha] [-rawbits] [-verbose] [-version] [inputfile]
PARAMETERS
-width <width>
Specifies the desired width of the output image in pixels.
-height <height>
Specifies the desired height of the output image in pixels.
-scale <scale>
A floating-point value to scale the 16-bit intensity values before converting to 8-bit. Useful for manual adjustment.
-maxval <maxval>
Explicitly sets the maximum 16-bit input value that will map to 255 (or 65535 with -rawbits).
-minval <minval>
Explicitly sets the minimum 16-bit input value that will map to 0.
-auto
Automatically determines the minimum and maximum 16-bit intensity values from the input data to optimize scaling, preventing clipping and maximizing contrast.
-colorspec <channel>
Determines which specific data channel from the Leica raw stream (e.g., Red, Green, Blue, Intensity, Color, X-coordinate) is used for the output image's brightness.
-x
Inverts the X-axis coordinate mapping, flipping the image horizontally.
-y
Inverts the Y-axis coordinate mapping, flipping the image vertically.
-z
Inverts the Z-axis coordinate mapping, useful for specific viewing orientations.
-alpha
Outputs a PGM (Portable Graymap) image with a maxval of 65535, intended to be used as an alpha channel for transparency in other applications.
-rawbits
Produces a PGM (Portable Graymap) image with a maxval of 65535, preserving the original 16-bit data depth without scaling down to 8-bit, for full precision.
-verbose
Prints informational messages about the conversion process, such as detected min/max values or scaling factors, to standard error.
-version
Prints the version information of the Netpbm package and then exits.
DESCRIPTION
lss16toppm is a specialized command-line utility from the Netpbm image processing toolkit. It is designed to convert raw 16-bit data streams generated by Leica ScanStation 3000 or 2900 laser scanners into standard Portable Pixmap (PPM) or Portable Graymap (PGM) image formats.
The input data typically contains intensity readings, which lss16toppm transforms into brightness values for the output image. By default, it scales the 16-bit intensity values (0-65535) down to 8-bit (0-255) for standard PPM output. However, it can also preserve the 16-bit depth by outputting a PGM with a maxval of 65535, useful for applications requiring higher precision.
The command allows users to specify image dimensions, scaling behavior, and even which specific data channel (e.g., Red, Green, Blue, Intensity, Color, X-coordinate) from the raw stream should be used to form the output image.
CAVEATS
The command requires input data to be in the specific raw 16-bit format generated by Leica ScanStation 3000/2900 devices. It cannot process arbitrary raw image data. The command expects a specific structure for the input data, often including intensity, X, Y, Z, and Color components. Misconfigured input or non-standard Leica data will likely lead to incorrect or corrupt output.
Output is always to standard output; redirect to a file for saving (e.g., lss16toppm input.lss > output.ppm).
STANDARD I/O BEHAVIOR
If no inputfile is specified, lss16toppm reads raw data from standard input (stdin). The converted image is always written to standard output (stdout), making it suitable for piping with other Netpbm commands or redirecting to a file. For example, cat rawdata.lss | lss16toppm -width 640 -height 480 > image.ppm.
INTEGRATION WITH NETPBM TOOLS
Since lss16toppm outputs standard PPM or PGM format, its output can be easily piped into other Netpbm utilities for further processing. This includes operations such as converting to other common image formats (e.g., PNG, JPEG), resizing, or applying various image manipulations using tools like pnmtojpeg, pnmtopng, or pamscale.
HISTORY
lss16toppm is part of the extensive Netpbm image processing toolkit, a collection of graphics utilities that originated in the late 1980s. While the core Netpbm project has a long history, this specific utility was developed to address the specialized need of converting proprietary raw data from Leica ScanStation laser scanners, reflecting the toolkit's adaptability to various niche image processing tasks and its continuous evolution to support new formats and hardware.