HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

ppmtoxpm — Convert a PPM image to an X11 version 3 pixmap. More information: <https://netpbm.sourceforge.net/do

Submitted by: @import:tldr-pages··
0
Viewed 0 times
ppmtoxpmcommandconvertcliimageversionx11ppm

Problem

How to use the ppmtoxpm command: Convert a PPM image to an X11 version 3 pixmap. More information: <https://netpbm.sourceforge.net/doc/ppmtoxpm.html>.

Solution

ppmtoxpm — Convert a PPM image to an X11 version 3 pixmap. More information: <https://netpbm.sourceforge.net/doc/ppmtoxpm.html>.

Convert a PPM image to a XPM image:
ppmtoxpm {{path/to/input_file.ppm}} > {{path/to/output_file.xpm}}


Specify the prefix string in the output XPM image:
ppmtoxpm {{[-n|-name]}} {{prefix_string}} {{path/to/input_file.ppm}} > {{path/to/output_file.xpm}}


In the output XPM file, specify colors by their hexadecimal code instead of their name:
ppmtoxpm {{[-h|-hexonly]}} {{path/to/input_file.ppm}} > {{path/to/output_file.xpm}}


Use the specified PGM file as a transparency mask:
ppmtoxpm {{[-a|-alphamask]}} {{path/to/alpha_file.pgm}} {{path/to/input_file.ppm}} > {{path/to/output_file.xpm}}

Code Snippets

Convert a PPM image to a XPM image

ppmtoxpm {{path/to/input_file.ppm}} > {{path/to/output_file.xpm}}

Specify the prefix string in the output XPM image

ppmtoxpm {{[-n|-name]}} {{prefix_string}} {{path/to/input_file.ppm}} > {{path/to/output_file.xpm}}

In the output XPM file, specify colors by their hexadecimal code instead of their name

ppmtoxpm {{[-h|-hexonly]}} {{path/to/input_file.ppm}} > {{path/to/output_file.xpm}}

Use the specified PGM file as a transparency mask

ppmtoxpm {{[-a|-alphamask]}} {{path/to/alpha_file.pgm}} {{path/to/input_file.ppm}} > {{path/to/output_file.xpm}}

Context

tldr-pages: common/ppmtoxpm

Revisions (0)

No revisions yet.