diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-11-15 03:42:53 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-11-15 03:42:53 +0000 |
commit | 5aace0df055cf5e6f0b655fb6475d060971c4cf4 (patch) | |
tree | d42326b57ee65d8cd0f40874975af63007833928 /pamtogif.html | |
parent | 736ac3d44de892065871db1c0167421d8643323a (diff) | |
download | netpbm-mirror-5aace0df055cf5e6f0b655fb6475d060971c4cf4.tar.gz netpbm-mirror-5aace0df055cf5e6f0b655fb6475d060971c4cf4.tar.xz netpbm-mirror-5aace0df055cf5e6f0b655fb6475d060971c4cf4.zip |
miscellaneous update
git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@2313 9d0c8265-081b-0410-96cb-a4ca84ce46f8
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. |