jpegtopnm

converts JFIF/JPEG images to Netpbm PNM format

TLDR

Convert JPEG to PNM
$ jpegtopnm [image.jpg] > [image.pnm]
Convert with EXIF extraction
$ jpegtopnm -exif=[exif.dat] [image.jpg] > [image.pnm]
Repair corrupted JPEG
$ jpegtopnm -repair [corrupted.jpg] > [output.pnm]
Display comments from JPEG
$ jpegtopnm -comments [image.jpg] > /dev/null

SYNOPSIS

jpegtopnm [options] [filename]

DESCRIPTION

jpegtopnm converts JFIF/JPEG images to Netpbm PNM format. Outputs PPM for color images or PGM for grayscale. Part of the Netpbm toolkit, it uses the Independent JPEG Group's library for decoding.

PARAMETERS

-repair

Attempt to salvage data from corrupted JPEG.
-exif file
Extract EXIF data to file.
-comments
Print comments from JPEG file.
-dct method
DCT method: int, fast, or float.
-multiple
Read multiple images from stream.

INSTALL

sudo apt install netpbm
sudo dnf install netpbm
sudo pacman -S netpbm
sudo apk add netpbm
sudo zypper install netpbm
brew install netpbm
nix profile install nixpkgs#netpbm

SEE ALSO

pnmtojpeg(1), djpeg(1), pamscale(1)