diff options
Diffstat (limited to 'pamtogif.html')
-rw-r--r-- | pamtogif.html | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/pamtogif.html b/pamtogif.html index 48f8168e..61fe6ec7 100644 --- a/pamtogif.html +++ b/pamtogif.html @@ -64,7 +64,9 @@ readers conceivably could not recognize GIF89. <p>The GIF format is not capable of representing an image with more than 256 colors in it (it contains a color map with a maximum size of 256). If the image you want to convert has more colors than that (<b>ppmhist</b> -can tell you), you can use <b>pnmquant</b> to reduce it to 256. +can tell you), you can use <b>pnmquant</b> to reduce it to 256. Or +use the more complex but faster method described under the <b>-mapfile</b> +option. <p>If your input image is a PAM with transparency information, <b>ppmtogif</b> uses one entry in the GIF colormap specifically for the transparent pixels, @@ -121,10 +123,29 @@ duplication of colors in the image is irrelevant. <p>The map file's depth must match the number of color components in the input (which is not necessarily the same as the input's depth -- -the input might have an alpha plane in addition). If your map file +the input might have a transparency plane in addition). If your map file does not, or it <em>might</em> not, run your input through <b>pnmremap</b> using the same map file so that it does. +<p>You can use <b>-mapfile</b> to speed up conversion of an image where you +already have a map file because of earlier processing of your image. For +example, it is common to start with an image that has more than 256 colors +and remap its colors to a set of 256 colors so that <b>pamgtogif</b> can +convert it (a GIF can have only 256 colors; <b>pamtogif</b> without +<b>-mapfile</b> fails on any image that has more than that) with +<b>pnmquant</b>. When you do this, <b>pnmquant</b> generates a palette to do +the color quantization, then <b>pamtogif</b> generates an identical palette +from the quantized image. You can save computation by generating the palette +once: + +<pre> +<kbd> + $ pnmcolormap 256 myimage.ppm >/tmp/colormap.ppm + $ pamtogif myimage.ppm -mapfile=/tmp/colormap.ppm >output.gif +</kbd> +</pre> + + <DT><B>-transparent=</B><I>color</I> <DD> @@ -161,9 +182,9 @@ such an option because it was not capable of taking PAM input that contains a transparency (alpha) plane, so one used this option to supply a transparency plane as a separate PGM file. - This option names a PGM file that contains an alpha mask for the + This option names a PGM file that contains a transparency mask for the image. <B>pamtogif</B> creates fully transparent pixels wherever the -alpha mask indicates transparency greater than 50%. The color of +transparency mask indicates transparency greater than 50%. The color of those pixels is that specified by the <B>-alphacolor</B> option, or black by default. @@ -172,7 +193,7 @@ addition to the entries for colors that are actually in the image. It marks that colormap entry as transparent and uses that colormap index in the output image to create a transparent pixel. -<P> The alpha image must be the same dimensions as the input +<P> The transparency image must be the same dimensions as the input image, but may have any maxval. White means opaque and black means transparent. |