Plan 9 from Bell Labs’s /usr/web/sources/contrib/pac/sys/doc/netpbm/ms/infotopam.ms

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


<?xml version="1.1" encoding="iso-8859-1" ?>
.TL
Infotopam User Manual
.SH 1
infotopam
.LP
.LP
Updated: 07 April 2004
.LP
Table Of Contents
.SH 2
NAME
.LP
.LP
infotopam - convert Amiga .info icons to PAM
.SH 2
SYNOPSIS
.LP
.LP
\fBinfotopam\fR
[\fB-forcecolor\fR]
[\fB-numcolors\fR \fInumcolors\fR]
[\fB-selected\fR]
[\fIindex color\fR ...]
[\fIfilename\fR]
.LP
Minimum unique abbreviation of option is acceptable.  You may use double
hyphens instead of single hyphen to denote options.  You may use white space in
place of the equals sign to separate an option name from its value.
.SH 2
EXAMPLES
.LP
.LP
By default, \fBinfotopam\fR converts the first icon in a .info file:
.DS L
    infotopam amiga.info > amiga.first.pam
  
.DE
.LP
Use the \fI-selected\fR option to convert the second icon in a .info
file.  Here \fBinfotopam\fR reads from Standard Input:
.DS L
    infotopam -selected < amiga.info > amiga.second.pam
  
.DE
.LP
Use the \fI-forcecolor\fR option to force color conversion for a 1
bit-plane .info file:
.DS L
    infotopam -forcecolor bw.info > bw.pam
  
.DE
.LP
Use \fI-numcolors\fR to override colors for indexes 0 and 3.  Notice the
two ways to specify the color:
.DS L
    infotopam -numcolors 2 0 green 3 #FF0000 icon.info > icon.pam
  
.DE
.LP
Since Amiga monitors do not use square pixels, some icons may appear
squished.  Filtering the output through \fBpamscale\fR can fix this:
.DS L
     infotopam squish.info | pamtopnm | pamscale -yscale 1.7 > normal.pnm
  
.DE
.SH 2
DESCRIPTION
.LP
.LP
This program is part of Netpbm.
.LP
\fBinfotopam\fR converts an Amiga .info (icon) file to a PAM image.
\fBinfotopam\fR reads a .info file from \fIfilename\fR, or from Standard
Input if you do not specify a file name, and writes the converted PAM image to
Standard Output.
.LP
\fBinfotopam\fR currently handles 1 and 2 bit-plane icons.  If the .info
icon only has 1 bit-plane, \fBinfotopam\fR generates a bitmap
(black&white) PAM image; otherwise it generates a color PAM image.  You
can force \fBinfotopam\fR to convert 1 bit-plane images to color PAM images by
using the \fI-forcecolor\fR option.
.SH 2
OPTIONS
.LP
.RS
.IP "\fB-forcecolor\fR"
.LP
Forces \fBinfotopam\fR to convert 1 bit-plane icons to color PAM
images instead of bitmap PAM images.  \fBinfotopam\fR uses the index 2
color for black and the index 1 color for white (more on this
below).
.IP "\fB-numcolors\fR \fInumcolors\fR"
.LP
Tells \fBinfotopam\fR how many colors to override.  Pixels in the
Amiga .info files are assigned an index value rather than a specific color.
The standard colors for a 2 bit-plane icon are:
.DS L
    Index 0:  Blue   (00, 55, AA)
    Index 1:  White  (FF, FF, FF)
    Index 2:  Black  (00, 00, 20)
    Index 3:  Orange (FF, 8A, 00)
  
.DE
.LP
To override the colors, first specify how many colors to override using
\fI-numcolors\fR, then specify an (\fIindex color\fR) pair for each color
you want to override, where \fIindex\fR is a value from 0 to 3 and
\fIcolor\fR the the new color for that index.  Specify \fIcolor\fR as
described for the \fBppm_parsecolor()\fR
argument.
.IP "\fB-selected\fR"
Tells \fBinfotopam\fR to convert the selected (second) icon instead of
the normal (first) icon.  Each Amiga .info icon file contains two icon
images.  The first image is the normal, unselected icon, and the second
image is the selected icon.  By default \fBinfotopam\fR converts the first
icon.  You can tell \fBinfotopam\fR to convert the second icon by using the
\fI-selected\fR option.
.RE
.LP
All options can be abbreviated to their shortest unique prefix.
.SH 2
SEE ALSO
.LP
.LP
pam
pamtopnm
pamscale
.SH 2
NOTES
.LP
.LP
Thanks to the following people on comp.sys.amiga.programmer for tips
and pointers on decoding the info file format:
.IP \(bu
Ben Hutchings
.IP \(bu
Thomas Richter
.IP \(bu
Kjetil Svalastog Matheussen
.IP \(bu
Anders Melchiorsen
.IP \(bu
Dirk Stoecker
.IP \(bu
Ronald V.D.
.LP
.LP
The format of the Amiga .info file is as follows:
.DS L
    DiskObject header            78 bytes
    Optional DrawerData header   56 bytes
    First icon header            20 bytes
    First icon data              Varies
    Second icon header           20 bytes
    Second icon data             Varies  
  
.DE
.LP
The DiskObject header contains, among other things, the magic number
(0xE310), the object width and height (inside the embedded Gadget header),
and the version.
.LP
Each icon header contains the icon width and height, which can be smaller
than the object width and height, and the number of bit-planes.
.LP
The icon data has the following format:
.LP
\fIBIT-PLANE\fR planes, each with \fIHEIGHT\fR rows of (\fIWIDTH\fR
+15) / 16 * 2 bytes length.
.LP
So if you have a 9x3x2 icon, the icon data will look like this:
.DS L
    aaaa aaaa a000 0000
    aaaa aaaa a000 0000
    aaaa aaaa a000 0000
    bbbb bbbb b000 0000
    bbbb bbbb b000 0000
    bbbb bbbb b000 0000
  
.DE
.LP
where \fIa\fR is a bit for the first bit-plane, \fIb\fR is a bit for the
second bit-plane, and \fI0\fR is padding.  Thanks again to Ben Hutchings for
his very helpful post!
.SH 2
HISTORY
.LP
.LP
\fBinfotopam\fR was new in Netpbm 10.22 (April 2004).
.SH 2
LIMITATIONS
.LP
.LP
\fBinfotopam\fR currently only handles 1 and 2 bit-plane icons.
.LP
There is no \fBpamtoinfo\fR command, since the .info files contain a lot
more than just icon data, and mapping the colors would be difficult.
.SH 2
AUTHOR
.LP
.LP
Copyright (C) 2000, 2004 by Richard Griswold.
.br
\l'5i'
.SH 2
Table Of Contents
.LP
.IP \(bu
NAME
.IP \(bu
SYNOPSIS
.IP \(bu
EXAMPLES
.IP \(bu
DESCRIPTION
.IP \(bu
OPTIONS
.IP \(bu
SEE ALSO
.IP \(bu
NOTES
.IP \(bu
HISTORY
.IP \(bu
LIMITATIONS
.IP \(bu
AUTHOR
.LP

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.