ppmtoarbtxt bodyskl [-hd headskl] [-tl tailskl] [ppmfile]
This program is part of netpbm(1).
ppmtoarbtxt generates simple text-based graphics formats based on format descriptions given as input. A text-based graphics format is one in which an image is represented by text (like PNM plain format, but unlike PNM raw format).
ppmtoarbtxtreads a PPM image as input. For each pixel in the image, ppmtoarbtxt writes the contents of the skeleton file bodyskl, with certain substitutions based on the value of the pixel, to stdout. The substitutions are as follows:
#(ired) is equivalent to #(ired %d 0 255).
#(fred) is equivalent to #(fred %f 0.0 1.0).
If the skeleton file ends with a LF-character, ppmtoarbtxt ignores it -- it does not include it in the output.
Here we generate a PGM plain-format image with gray inversion (like ppmtopgm | pnminvert).
Contents of our head skeleton file:
P2 #(width) #(height) 255
Contents of our body skeleton file:
#(ilum %d 255 0)
Here we generate a povray file where each pixel is represented by a sphere at location (x,y,z) = (posx,height-posy,luminance). The color of the sphere is the color of the pixel.
Contents of our head skeleton:
#include 'colors.inc'
#include 'textures.inc'
camera {
location <#(width) * 0.6, #(height) * 0.7, 80>
look_at <#(width) * 0.5, #(height) * 0.5, 0>
}
light_source { <#(width) * 0.5, #(height) * 0.5, 25> color White
}
Contents of our body skeleton:
sphere { <#(posx),#(height)-#(posy),#(ilum %d 0 10)>, 0.5
texture {
pigment {
color rgb <#(fred),#(fgreen),#(fblue)>
}
finish {
phong 1
}
}
}
ppmtoarbtxt was added to Netpbm in Release 10.14 (March 2003). It existed under the name ppmtotxt since 1995.
Copyright (C) 1995 by Peter Kirchgessner