82659 packages online


No screenshot available
Short:Utility to convert ppm images to .info files.
Author:mheinz at (Michael Heinz)
Uploader:mheinz ssw com (Michael Heinz)
Keywords:amiga graphics workbench icon, info, ppm
Download: - View contents
+ This utility converts ppm images to .info files.


	COPYRIGHT 1994 Michael W. Heinz, Sr.  All Rights Reserved.
	This application is freely distributable, provided that all 
	documentation is included.



	One of my all time favorite utilities was "iconize".  Written in 1990,
	iconize would read an ILBM image and scale it into an Amiga WB icon.
	Unfortunately, it only used one palette - and if your WB didn't use it, 
	the icons would look very strange.

	I'm also a big fan of the PBM/PPM set of tools.  These tools, written 
	for UNIX systems are easily ported to the Amiga and provide some 
	powerful image conversion and processing tools, even if they have 
	absolutely no user interface.

	Combining these two ideas, I came up with PPMTOINFO.  PPMTOINFO 
	converts a PPM formatted image into a WorkBench icon file.  For it to be 
	useful, you will also need the ppm tools (the latest version is called 
	"netpbm" and can be found on the aminet.)


	ppmtoinfo [-tool {default tool}] 0[-tooltype {tool type}]10 
			    -map {mapfile} -icon {iconfile} [{ppmfile}]

	In it's simplest form, ppmtoinfo takes three arguments - the name of 
	the ppm file to convert, the name of the ppm file holding the palette 
	and the name of the icon to create.  (.info will be added to the name 

	If -tool is provided, it will be used to set the default tool of the 
	icon. If one or more -tooltype records are provided, they can be used 
	to set the tool types of the icon.  Up to 10 -tooltype records are 

	The ppmfile (the image to be converted) should be in the P6 format 
	used by standard ppm commands.  It should be scaled to the desired 
	size of the icon, because the icon will be the same size as the 
	original image.  If the ppmfile is not specified in the command line,
    it will be read from the standard input.  This conforms to the usual
    operation of a PPM utility.

	The map file is needed because all PPM images are "true color" - they 
	don't use palettes.  The map file is defined in the P3 format and shows 
	the palette, 1 pixel per color.  For example, here is the palette for a 
	standard MagicWB arrangement:

	8 1
	144 144 144
	0 0 0 
	240 240 240
	80 112 160
	128 128 128
	160 160 160
	160 144 128
	224 160 144

	Notice that the colors go from 0 to 255, rather than from 0 to 16.  
	Just multiply your regular palette by 16.  Note also that the palette 
	must include every color present in the original image.  ppmtoinfo 
	makes no attempt to dither or remap the original image - it just 
	translates it into a .info file.  (You'll see why in a minute.)

	Typically, you will use this tool in combination with other ppm utilities 
	and tools (For example, djpeg converts jpg images to ppm format.)

	So say I wanted to create an icon for a jpg file called "dragonglass".  
	I would perform the following steps:

	1.	Convert the jpg to a ppm file:				
				djpeg dragonglass.jpg dg.ppm
	2.	Scale the ppm file to icon size:
				pnmsize -xsize 64 dg.ppm >small.ppm
        (note that I only specify the size in the x axis.  This allows 
        pnmsize to scale the y axis mathematically to give the icon
        the same appearance as the original image.)
	3.	Recolor the ppm file to match your WorkBench:
				ppmquant -fs -map wb_map.ppm small.ppm >icon.ppm
	4.	Convert the ppm file to an icon:
				ppmtoinfo <icon.ppm -map wb_map.ppm -icon DragonGlass.jpg \
                        -tool RetinaDisplay

	The result will be a new icon called "".  Note that
	the palette file used in step 4 is the same one used to re-color the
	image in step 3.  This is why ppmtoinfo doesn't provide built-in 
	recoloring or dithering capabilities - ppmquant already does an
	excellent job.

	To simplify the conversion process, you can use the following script,
	which converts iff images to icons of the same name:

    .key file/a,opt/f
    .bra {
    .ket }

    echo "Converting {file} to an icon.  Opts: {opt}"
    run ilbmtoppm "{file}" >pipe:mi_a
    run pnmscale >pipe:mi_b -xsize 64 pipe:mi_a
    run ppmquant >pipe:mi_c -fs -map pbm:wb_map.ppm pipe:mi_b
    ppmtoinfo <pipe:mi_c {opt} -map pbm:wb_map.ppm -icon "{file}" 

    You can use the "SPAT" script (found in your s: directory) to automatically
    build icons for all the images in a directory.  For example:
    SPAT makeicon ~(#?.info) -tool RetinaDisplay

	Works on my machine!

Michael Heinz
(mheinz at

Contents of gfx/pbm/ppmtoinfo.lha
---------- ----------- ------- ------- ------ ---------- ------------ -------------
drwxr-xr-x   602/202         0       0 ****** -lhd- 0000              ppmtoinfo/
-rw-r--r--   602/202        40      40 100.0% -lh0- d30e              ppmtoinfo/.info
-rw-r--r--   602/202        56      56 100.0% -lh0- 7514              ppmtoinfo/Touch
-rw-r--r--   602/202       808    1577  51.2% -lh5- 75a6              ppmtoinfo/
-rw-r--r--   602/202      1013    1429  70.9% -lh5- 8e3f              ppmtoinfo/
-rw-r--r--   602/202      2471    3700  66.8% -lh5- ee2c              ppmtoinfo/debug
-rw-r--r--   602/202       667    1531  43.6% -lh5- 8314              ppmtoinfo/
-rw-r--r--   602/202       552    1537  35.9% -lh5- 1695              ppmtoinfo/
-rw-r--r--   602/202       171     282  60.6% -lh5- 2848              ppmtoinfo/makeicon
-rw-r--r--   602/202       496    1537  32.3% -lh5- 6c78              ppmtoinfo/
-rw-r--r--   602/202       369    1552  23.8% -lh5- 8e99              ppmtoinfo/
-rw-r--r--   602/202     12381   21164  58.5% -lh5- 2a89              ppmtoinfo/ppmtoinfo
-rw-r--r--   602/202      2856    8196  34.8% -lh5- 32c2              ppmtoinfo/ppmtoinfo.c
-rw-r--r--   602/202       496    1537  32.3% -lh5- 5b23              ppmtoinfo/
-rw-r--r--   602/202      2030    4407  46.1% -lh5- 724c              ppmtoinfo/ppmtoinfo.doc
-rw-r--r--   602/202       495    1537  32.2% -lh5- cd8e              ppmtoinfo/
-rw-r--r--   602/202       880    1464  60.1% -lh5- bd18              ppmtoinfo/
-rw-r--r--   602/202       104     135  77.0% -lh5- c88b              ppmtoinfo/ppmtoinfo.lnk
-rw-r--r--   602/202        77     100  77.0% -lh5- fe7e              ppmtoinfo/sascopts
-rw-r--r--   602/202        55     101  54.5% -lh5- 98db              ppmtoinfo/wb_map.ppm
-rw-r--r--   602/202      2177    4774  45.6% -lh5- 1212              ppmtoinfo.readme
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        21 files   28194   56656  49.8%            Feb  7  1994

Aminet © 1992-2019 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>