LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pamfix

repairs corrupted Netpbm images

TLDR

Clip sample values that exceed the maxval
$ pamfix -clip [corrupted.pam] > [fixed.pam]
copy
Raise the maxval to accommodate out-of-range values
$ pamfix -changemaxval [corrupted.pam] > [fixed.pam]
copy
Truncate the image at the first invalid sample value
$ pamfix -truncate [corrupted.pam] > [fixed.pam]
copy
Fix with verbose output
$ pamfix -clip -verbose [corrupted.pam] > [fixed.pam]
copy

SYNOPSIS

pamfix [options] [file]

DESCRIPTION

pamfix reads a stream that is mostly a Netpbm image but may have certain types of corruptions and produces a valid Netpbm image that preserves much of the information in the original. It handles two primary corruption types: truncated streams and illegally large sample values. Part of the Netpbm package.

PARAMETERS

FILE

Input PAM/PNM file. Reads from standard input if not specified.
-clip
Clip all pixel values that exceed the maxval stated in the header to the maxval. Cannot be combined with -changemaxval.
-changemaxval
Raise the maxval to accommodate pixel values that exceed the maxval stated in the header, lowering the fraction represented by every sample. Cannot be combined with -clip.
-truncate
Truncate the image at the first invalid sample value. When neither -clip nor -changemaxval is specified, this is the default behavior for out-of-range values.
-verbose
Report details of the repair to standard error.

INSTALL

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

CAVEATS

You cannot specify both -clip and -changemaxval. May not fix all types of corruption. Some data loss is possible with truncation.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid