LinuxCommandLibrary

ppmglobe

Visualize PPM images on a rotating globe

TLDR

Transform an image to strips that can be cut out and glues onto a sphere

$ ppmglobe [number_of_strips] [path/to/image.ppm] > [path/to/output.ppm]
copy

Use the specified color for the areas between the strips
$ ppmglobe [[-b|-background]] [red] [number_of_strips] [path/to/image.ppm] > [path/to/output.ppm]
copy

SYNOPSIS

ppmglobe [options] [map_image]

PARAMETERS

-background=color
    Sets the color of the background area not covered by the globe. Default is black.

-earth=color
    Sets the color of the land masses. Default is green.

-sea=color
    Sets the color of the oceans. Default is blue.

-border=color
    Sets the color of the border around land masses when a map image is used. Default is white.

-grid=color
    Sets the color of the latitude/longitude grid lines. Default is red.

-noearth
    Suppresses drawing of the land masses.

-nosea
    Suppresses drawing of the oceans.

-nogrid
    Suppresses drawing of the latitude/longitude grid.

-noborder
    Suppresses drawing of the border.

-width=pixels
    Sets the width of the output image in pixels. Default is 300.

-height=pixels
    Sets the height of the output image in pixels. Default is 300.

-x=degrees
    Sets the longitude of the point at the center of the image on the globe. Default is 0.

-y=degrees
    Sets the latitude of the point at the center of the image on the globe. Default is 0.

-z=degrees
    Sets the rotation about the axis formed by the central point. Default is 0.

-gamma=gamma_value
    Applies gamma correction to the output image.

-truecolor
    Forces the output image to be a 24-bit truecolor PPM. By default, it's 8-bit per color component.

-azimuthal
    Specifies an azimuthal projection (the default globe view).

-azimuthaldistance=distance
    Specifies the distance of the projection plane from the globe's center for azimuthal projections. Default is 1.0 (orthographic).

-rectangular
    Specifies a rectangular (equirectangular) projection.

-mercator
    Specifies a Mercator projection.

-mercatorwidth=width
    Sets the width for Mercator projections; height is computed to maintain aspect ratio. Default is 300.

-rectangularwidth=width
    Sets the width for rectangular projections; height is computed to maintain aspect ratio. Default is 300.

-gridlat=degrees
    Sets the spacing of latitude grid lines in degrees. Default is 15.

-gridlon=degrees
    Sets the spacing of longitude grid lines in degrees. Default is 15.

-resolution=number
    Sets the resolution of the globe, in terms of points per pixel. Higher values yield smoother curves but increase render time. Default is 1.0.

-antialias=number
    Sets the number of antialiasing samples per pixel. Higher values produce smoother curves but increase render time. Default is 0 (no antialiasing).

map_image
    Optional file name of an input image to use as the map. If not specified, a built-in map is used.

DESCRIPTION

The ppmglobe command, part of the Netpbm toolkit, generates a PPM (Portable Pixmap) image depicting a map of the world. By default, it projects a high-resolution political map onto a globe, complete with an optional grid, border, and background. Users can customize various aspects, including colors for land, sea, background, grid, and border.

The command supports different map projections: the default azimuthal (globe) projection, or flat rectangular (equirectangular) and Mercator projections. It allows specifying the output image dimensions, the central viewpoint for globe projections, and the spacing for latitude and longitude grid lines. Advanced options include gamma correction, truecolor output, resolution control, and antialiasing for smoother rendering.

Users can also provide their own map image as input, which ppmglobe will scale and color according to specified options, or use the original colors if preferred. This makes ppmglobe a versatile tool for generating custom world map visualizations.

CAVEATS

When providing a custom map_image, it is expected to be a single-plane PNM image (PGM or PBM) if you wish ppmglobe to color it with -earth and -sea. If the input is a PPM image or you want to retain its original colors, use -noearth and -nosea. The input map is scaled to 4096x2048 and is expected to be an equirectangular projection spanning -180 to 180 degrees longitude horizontally and -90 to 90 degrees latitude vertically.

BUILT-IN MAP

By default, ppmglobe uses a high-resolution political map built directly into the program. This map is used if no map_image argument is provided.

COLOR SPECIFICATION

Colors for options like -background, -earth, etc., can be specified in various ways, typically by name (e.g., 'red', 'lightgreen'), RGB hexadecimal (e.g., '#FF0000'), or RGB decimal (e.g., '255,0,0'). Refer to the ppm(5) man page for full color specification details.

OUTPUT FORMAT

The output is always a PPM (Portable Pixmap) image, which is a simple, uncompressed pixelmap format. It can be further processed by other Netpbm tools or converted to other image formats.

HISTORY

ppmglobe is part of the Netpbm project, a long-standing open-source package of graphics programs and a programming library for handling graphical images. Netpbm began in the early 1990s as a collection of tools for manipulating PBM, PGM, and PPM image formats. ppmglobe specifically provides a utility for generating geographical visualizations, leveraging the core Netpbm image manipulation capabilities. Its development has focused on offering various projection types and customization options for rendering world maps.

SEE ALSO

ppm(5), pnmgamma(1), ppm(1), netpbm(1)

Copied to clipboard