# ppmtoilbm

Updated: 15 January 2022
Table Of Contents

## NAME

ppmtoilbm - convert a PPM image into an ILBM file

## SYNOPSIS

ppmtoilbm [-maxplanes|-mp N] [-fixplanes|-fp N] [-ham6|-ham8] [{-dcbits|-dcplanes} r g b] [ -normal|-hamif|-hamforce|-24if|-24force| -dcif|-dcforce|-cmaponly ] [-ecs|-aga] [-compress|-nocompress] [-cmethod type] [-map ppmfile] [ppmfile]

## DESCRIPTION

This program is part of Netpbm.

ppmtoilbm reads a PPM image as input. Produces an ILBM file as output. ppmtoilbm understands the following ILBM types:

- Normal ILBMs with 1-16 planes
- Amiga HAM with 3-16 planes
- 24 bit
- Color map (BMHD + CMAP chunk only, nPlanes = 0)
- Unofficial direct color. 1-16 planes for each color component.

Chunks written: BMHD, CMAP, CAMG (only for HAM), BODY (not for colormap files) unofficial DCOL chunk for direct color ILBM.

## OPTIONS

In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), ppmtoilbm recognizes the following command line options:

Options marked with (*) can be prefixed with a "no", e.g. "-nohamif". All options can be abbreviated to their shortest unique prefix.

-maxplanes | -mp n
  (default 5, minimum 1, maximum 16) Maximum planes to write in a normal ILBM. If the image does not fit into <n> planes, ppmtoilbm writes a HAM file (if -hamif is used), a 24bit file (if -24if is used) or a direct color file (if -dcif is used) or aborts with an error.
-fixplanes | -fp b
  (min 1, max 16) If a normal ILBM is written, it will have exactly <n> planes.
-hambits | -hamplanes n
  (default 6, min 3, max 16) Select number of planes for HAM picture. The current Amiga hardware understands 6 and 8 planes, so for now you should only use this values.
-normal
  Turns off -hamif/-24if/-dcif, -hamforce/-24force/-dcforce and -cmaponly. Also sets compression type to byterun1.

  This is the default.

-hamif (*)
-24if (*)
-dcif (*)
  Write a HAM/24bit/direct color file if the image does not fit into <maxplanes> planes.
-hamforce (*)
-24force (*)
-dcforce (*)
  Write a HAM/24bit/direct color file.
-dcbits r g b
-dcplanes r g b
  (default 5, min 1, max 16). Select number of bits for red, green and blue in a direct color ILBM.
-ecs
  Shortcut for: -hamplanes 6 -maxplanes 5

  This is the default.

-aga
  Shortcut for: -hamplanes 8 -maxplanes 8
-ham6
  Shortcut for: -hamplanes 6 -hamforce
-ham8
  Shortcut for: -hamplanes 8 -hamforce
-compress (*)
  This is the default.
  Compress the BODY chunk. The default compression method is byterun1. Compression requires building the ILBM image in memory; turning compression off allows stream-writing of the image, but the resulting file will usually be 30% to 50% larger. Another alternative is the -savemem option, this will keep memory requirements for compression at a minimum, but is very slow.
-cmethod none|byterun1
  This option does the same thing as -compress.
-map ppmfile
  Write a normal ILBM using the colors in <ppmfile> as the colormap. The colormap file also determines the number of planes; -maxplanes and -fixplanes are ignored.
-cmaponly
  Write a colormap file: only BMHD and CMAP chunks, no BODY chunk, nPlanes = 0.
-savemem
  See the -compress option.

## LIMITATIONS

HAM pictures will always get a grayscale colormap; a real color selection algorithm might give better results. On the other hand, this allows row-by-row operation on HAM images, and all HAM images of the same depth (no. of planes) share a common colormap, which is useful for building HAM animations.

## REFERENCES

Amiga ROM Kernel Reference Manual - Devices (3rd Ed.)
Addison Wesley, ISBN 0-201-56775-X

## SEE ALSO

ppm, ilbmtoppm

## HISTORY

For about a year in 1993-1994, there was a -savemem option.

There used to be a -floyd (aka -fs) option that was supposed to cause images to be dithered so that a larger number of colors in the PPM input could be represented in a smaller number of colors in the ILBM output. But it was never documented. Furthermore, developers discovered in January 2022 that the code for this was nonfunctional because of defects, and had been for a very long time and maybe always. Finally,, this functions is not appropriate in the Netpbm philosophy, because dithering should be done by a separate dithering program, not a format conversion program. Indeed, the programs ppmdither, pnmquant, and pnmremap can do this.

Therefore, since Netpbm 10.98 (March 2022), the dithering code has not been in the program and any attempt to use the options fails with a simple invalid option message. But the -nofloyd and -nofs options remain, doing nothing as they were designed to do, and still not documented. This is just in case something uses those options, since the cost of maintaining them is so small.

## AUTHORS

Copyright (C) 1989 by Jef Poskanzer.

Modified October 1993 by Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)

## Table Of Contents

- SYNOPSIS
- DESCRIPTION
- OPTIONS
- LIMITATIONS
- REFERENCES
- SEE ALSO
- HISTORY
- AUTHORS