Blame userguide/giftopnm.html

Packit 78deda
Packit 78deda
<HTML><HEAD><TITLE>Giftopnm User Manual</TITLE></HEAD>
Packit 78deda
<BODY>
Packit 78deda

giftopnm

Packit 78deda
Updated: 13 September 2012
Packit 78deda

Packit 78deda
Packit 78deda
Table Of Contents
Packit 78deda
Packit 78deda

NAME

Packit 78deda
giftopnm - convert a GIF file into a PNM image
Packit 78deda
Packit 78deda

SYNOPSIS

Packit 78deda
Packit 78deda
giftopnm
Packit 78deda
[--alphaout={alpha-filename,-}]
Packit 78deda
[-verbose]
Packit 78deda
[-comments]
Packit 78deda
[-image={N,all}]
Packit 78deda
[-repair]
Packit 78deda
[-quitearly]
Packit 78deda
[GIFfile]
Packit 78deda
Packit 78deda

Minimum unique abbreviation of option is acceptable. You may use double

Packit 78deda
hyphens instead of single hyphen to denote options.  You may use white
Packit 78deda
space in place of the equals sign to separate an option name from its value.
Packit 78deda
Packit 78deda

DESCRIPTION

Packit 78deda
Packit 78deda

This program is part of Netpbm.

Packit 78deda
Packit 78deda

This is a graphics format converter from the GIF format to the PNM

Packit 78deda
(i.e. PBM, PGM, or PPM) format.
Packit 78deda
Packit 78deda

If the image contains only black and maximally bright white, the

Packit 78deda
output is PBM.  If the image contains more than those two colors, but
Packit 78deda
only grays, the output is PGM.  If the image contains other colors,
Packit 78deda
the output is PPM.
Packit 78deda
Packit 78deda

A GIF image contains rectangular pixels. They all have the same

Packit 78deda
aspect ratio, but may not be square (it's actually quite unusual for
Packit 78deda
them not to be square, but it could happen).  The pixels of a Netpbm
Packit 78deda
image are always square.  Because of the engineering complexity to do
Packit 78deda
otherwise, giftopnm converts a GIF image to a Netpbm image
Packit 78deda
pixel-for-pixel.  This means if the GIF pixels are not square, the
Packit 78deda
Netpbm output image has the wrong aspect ratio.  In this case,
Packit 78deda
giftopnm issues an informational message telling you to run
Packit 78deda
pamscale to correct the output.
Packit 78deda
Packit 78deda

OPTIONS

Packit 78deda
Packit 78deda
Packit 78deda
--alphaout=alpha-filename
Packit 78deda
Packit 78deda
giftopnm creates a PBM file containing the transparency
Packit 78deda
information from the input image.  This transparency image is the same
Packit 78deda
dimensions as the input image, and each pixel of the transparency image tells
Packit 78deda
whether the corresponding pixel of the input image is transparent.  Black
Packit 78deda
means transparent; white means opaque.  If you don't
Packit 78deda
specify --alphaout, giftopnm does not generate a transparency
Packit 78deda
file, and if the input image has a transparency channel, giftopnm simply
Packit 78deda
discards it.
Packit 78deda
Packit 78deda

If you specify - as the filename, giftopnm writes the

Packit 78deda
transparency output to Standard Output and discards the image.
Packit 78deda
Packit 78deda

See pamcomp for one way to use

Packit 78deda
the transparency output file.  
Packit 78deda
Packit 78deda
-verbose
Packit 78deda
Packit 78deda
Produce verbose output about the GIF file input.
Packit 78deda
Packit 78deda
-comments
Packit 78deda
Packit 78deda
Packit 78deda
With this option, giftopnm issues messages showing the GIF comments
Packit 78deda
(A GIF89 stream can contain comments in comment extensions).
Packit 78deda

Packit 78deda
By default, giftopnm ignores comment extensions.
Packit 78deda
Packit 78deda
Packit 78deda
-image={N,all}
Packit 78deda
Packit 78deda
Packit 78deda
This option identifies which image from the GIF stream you want.  
Packit 78deda
You can select either one image or all the images.  Select all the 
Packit 78deda
images with all.  Select one image by specifying its sequence
Packit 78deda
number in the stream: 1, 2, 3, etc.
Packit 78deda
Packit 78deda

The default is just Image 1.

Packit 78deda
Packit 78deda

A GIF stream normally contains only one image, so you don't need

Packit 78deda
this option.  But some streams, including animated GIFs, have multiple
Packit 78deda
images.
Packit 78deda
Packit 78deda

When you select multiple GIF images, the output is a PNM stream with

Packit 78deda
multiple images.
Packit 78deda
Packit 78deda

If you specify a single image, giftopnm must read and

Packit 78deda
partially validate the images before that in the stream.  It may or may
Packit 78deda
not do the same for the images after it; see -quitearly.
Packit 78deda
Packit 78deda

The all value was added in Netpbm 10.16 (June 2003). Earlier

Packit 78deda
giftopnm can extract only one image.
Packit 78deda
Packit 78deda
-repair
Packit 78deda
Packit 78deda
This option makes giftopnm try to salvage what it can from an
Packit 78deda
invalid GIF input.
Packit 78deda
Packit 78deda

In particular, when giftopnm detects that the GIF input is

Packit 78deda
invalid so that it is impossible to determine what the pixels are
Packit 78deda
intended to be, it produces a single arbitrary color for all further
Packit 78deda
pixels in the image.  giftopnm processes the image from top to
Packit 78deda
bottom, left to right, so this means the bottommost pixels will be
Packit 78deda
this padding.
Packit 78deda
Packit 78deda

giftopnm issues warning messages when it salvages an image

Packit 78deda
in this way.
Packit 78deda
Packit 78deda

Without this option, giftopnm fails when it detects invalid

Packit 78deda
GIF input.  Any output it produces is arbitrary, and typically is not
Packit 78deda
a valid PNM image.
Packit 78deda
Packit 78deda

It is fairly common for an image to be corrupted such that is

Packit 78deda
started off as a valid GIF, but had the end of the file cut off.  An
Packit 78deda
interrupted network transfer tends to do this.  In this case,
Packit 78deda
giftopnm's salvage operation will produce a valid PNM image of
Packit 78deda
the proper dimensions, but with a single arbitrary color for the pixels
Packit 78deda
that were left out of the file.
Packit 78deda
Packit 78deda

This option was new in Netpbm 10.38 (March 2007). From 10.32 through

Packit 78deda
10.37, giftopnm always fails if it detects invalid GIF input.
Packit 78deda
Before 10.32, it succeeds in the case of a truncated image, and replaces
Packit 78deda
the missing pixels with arbitrary colors, not necessarily all the same
Packit 78deda
(The pre-10.32 behavior wasn't actually intended by the design).
Packit 78deda
Packit 78deda
Packit 78deda
-quitearly
Packit 78deda
Packit 78deda
This option makes giftopnm stop reading its input file as soon
Packit 78deda
as it has converted and output the images from the input that you requested.
Packit 78deda
By default, giftopnm reads until the end of the GIF stream, ignoring
Packit 78deda
any data after the images you requested.
Packit 78deda
Packit 78deda

Two reasons not to use this option:

Packit 78deda
    Packit 78deda
  • The input file is a pipe and the process that is filling that pipe
  • Packit 78deda
    expects the pipe to take the entire stream and will fail or get stuck
    Packit 78deda
    if it doesn't.
    Packit 78deda
    Packit 78deda
  • You want to validate the entire GIF stream.
  • Packit 78deda
    Packit 78deda
    Packit 78deda
    Packit 78deda

    Two reasons to use this option:

    Packit 78deda
    Packit 78deda
      Packit 78deda
    • It saves the time and other resources to read the end of the stream.
    • Packit 78deda
    • There are errors in the end of the stream that make giftopnm fail.
    • Packit 78deda
      Packit 78deda
      Packit 78deda

      This option has no effect if you also specify -image=all

      Packit 78deda
      Packit 78deda

      This option was new in Netpbm 10.35 (August 2006). Before that,

      Packit 78deda
      giftopnm always reads the entire stream.
      Packit 78deda
           
      Packit 78deda
      Packit 78deda
      Packit 78deda

      RESTRICTIONS

      Packit 78deda
      Packit 78deda

      This does not correctly handle the Plain Text Extension of the

      Packit 78deda
      GIF89 standard, since I did not have any example input files
      Packit 78deda
      containing them.
      Packit 78deda
      Packit 78deda

      SEE ALSO

      Packit 78deda
      Packit 78deda
      pamtogif,
      Packit 78deda
      ppmcolormask,
      Packit 78deda
      pamcomp,
      Packit 78deda
      <
      Packit 78deda
      HREF="http://www.lcdf.org/gifsicle">http://www.lcdf.org/gifsicle>,
      Packit 78deda
      ppm.
      Packit 78deda
      Packit 78deda

      AUTHOR

      Packit 78deda
      Packit 78deda

      Copyright (c) 1993 by David Koblas (

      Packit 78deda
      HREF="mailto:koblas@netcom.com">koblas@netcom.com)
      Packit 78deda
      Packit 78deda

      LICENSE

      Packit 78deda
      Packit 78deda

      As a historical note, for a long time if you used giftopnm,

      Packit 78deda
      you were using a patent on the LZW compression method which was owned
      Packit 78deda
      by Unisys, and in all probability you did not have a license from
      Packit 78deda
      Unisys to do so.  Unisys typically asked $5000 for a license for
      Packit 78deda
      trivial use of the patent.  Unisys never enforced the patent against
      Packit 78deda
      trivial users, and made statements that it is much less concerned
      Packit 78deda
      about people using the patent for decompression (which is what
      Packit 78deda
      giftopnm does than for compression.  The patent expired in
      Packit 78deda
      2003.
      Packit 78deda
      Packit 78deda

      Rumor has it that IBM also owns a patent covering giftopnm.

      Packit 78deda
      Packit 78deda

      A replacement for the GIF format that has never required any patent

      Packit 78deda
      license to use is the PNG format.
      Packit 78deda
      Packit 78deda
      Packit 78deda

      Packit 78deda
       

      Table Of Contents

      Packit 78deda
        Packit 78deda
      • SYNOPSIS
      • Packit 78deda
      • DESCRIPTION
      • Packit 78deda
      • OPTIONS
      • Packit 78deda
      • RESTRICTIONS
      • Packit 78deda
      • SEE ALSO
      • Packit 78deda
      • AUTHOR
      • Packit 78deda
      • LICENSE
      • Packit 78deda
        Packit 78deda
        </BODY>
        Packit 78deda
        </HTML>