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

pngtopam — Convert a PNG image to a Netpbm image. See also: `pamtopng`. More information: <https://netpbm.sourc

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

Problem

How to use the pngtopam command: Convert a PNG image to a Netpbm image. See also: pamtopng. More information: <https://netpbm.sourceforge.net/doc/pngtopam.html>.

Solution

pngtopam — Convert a PNG image to a Netpbm image. See also: pamtopng. More information: <https://netpbm.sourceforge.net/doc/pngtopam.html>.

Convert the specified PNG image to a Netpbm image:
pngtopam {{path/to/image.png}} > {{path/to/output.pam}}


Create an output image that includes both the main image and transparency mask of the input image:
pngtopam -alphapam {{path/to/image.png}} > {{path/to/output.pam}}


Replace transparent pixels by the specified color:
pngtopam {{[-m|-mix]}} {{[-ba|-background]}} {{color}} {{path/to/image.png}} > {{path/to/output.pam}}


Write tEXt chunks found in the input image to the specified text file:
pngtopam {{[-te|-text]}} {{path/to/file.txt}} {{path/to/image.png}} > {{path/to/output.pam}}

Code Snippets

Convert the specified PNG image to a Netpbm image

pngtopam {{path/to/image.png}} > {{path/to/output.pam}}

Create an output image that includes both the main image and transparency mask of the input image

pngtopam -alphapam {{path/to/image.png}} > {{path/to/output.pam}}

Replace transparent pixels by the specified color

pngtopam {{[-m|-mix]}} {{[-ba|-background]}} {{color}} {{path/to/image.png}} > {{path/to/output.pam}}

Write tEXt chunks found in the input image to the specified text file

pngtopam {{[-te|-text]}} {{path/to/file.txt}} {{path/to/image.png}} > {{path/to/output.pam}}

Context

tldr-pages: common/pngtopam

Revisions (0)

No revisions yet.