man-pages/man1/pnmcomp.1.html
2021-03-31 01:06:50 +01:00

216 lines
5.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of pnmcomp</TITLE>
</HEAD><BODY>
<H1>pnmcomp</H1>
Section: User Commands (1)<BR>Updated: 12 April 2000<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="ixAAB"></A>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
pnmcomp - composite (overlay) two portable anymap files together
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>pnmcomp</B>
[<B>-xoff=</B><I>X</I> | <B>-align=</B>{<B>left</B>,<B>center</B>,<B>right</B>}]
<BR>
[<B>-yoff=</B><I>Y</I> | <B>-valign=</B>{<B>top</B>,<B>middle</B>,<B>bottom</B>}]
<BR>
[<B>-alpha=</B><I>alpha-pgmfile</I>]
[<B>-invert</B>]
<BR>
<I>overlay</I>
[<I>pnm-input</I>]
[<I>pnm-output</I>]
<P>
Minimum unique abbreviations are acceptable.
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>pnmcomp</B>
reads two images and produces a composite image with one of the images
overlayed on top of the other. The images need not be the same size.
The input and outputs are PNM format image files.
<P>
In its simplest use,
<B>pnmcomp</B>
simply places the
<I>overlay</I>
file on top of the
<I>pnm-input</I>
file, blocking out the part of the
<I>pnm-input</I>
file beneath it.
If you specify the
<I>alpha-pgmfile</I>,
<B>pnmcomp</B>
uses it as an alpha mask, which means it determines the level of
transparency of each point in the overlay image. The alpha mask must
have the same dimensions as the overlay image. In places where the
alpha mask defines the overlay image to be opaque, the composite
output contains only the contents of the overlay image; the underlying
image is totally blocked out. In places where the alpha mask defines
the overlay image to be transparent, the composite output contains
none of the overlay image; the underlying image shows through
completely. In places where the alpha mask shows a value in between
opaque and transparent (translucence), the composite image contains a
mixture of the overlay image and the underlying image and the level of
translucence determines how much of each.
<P>
The alpha mask is a PGM file in which a white pixel represents opaqueness
and a black pixel transparency. Anything in between is translucent.
<P>
In some image file formats (PNG, for example), transparency
information (the alpha mask) is part of the definition of the image.
In the PNM formats, transparency is always embodied in a separate
companion file. The PNM converter programs that convert from an image
format such as PNG have options that allow you to extract the
transparency information to a separate file, which you can then use
as input to
<B>pnmcomp</B>.
<P>
The output image is always of the same dimensions as the underlying image.
<B>pnmcomp</B>
only uses parts of the overlay image that fit within the underlying
image.
<P>
To specify where on the underlying image to place the overlay image,
use the
<B>-xoff</B>,
<B>-yoff</B>,
<B>-align</B>,
and
<B>-valign</B>
options. Without these options, the default horizontal position is
flush left and the default vertical position is flush top.
<P>
The overlay and underlying images may be of different formats (e.g.
overlaying a PBM text image over a full color PPM image) and have different
maxvals. The output image has the more general of the two input formats
and a maxval that is the least common multiple the two maxvals (or the
maximum maxval allowable by the format, if the LCM is more than that).
<P>
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-invert</B>
<DD>
This option inverts the sense of the values in the alpha mask, which
effectively switches the roles of the overlay image and the underlying
image in places where the two intersect.
<DT id="2"><B>-xoff </B><I>X</I>
<DD>
<DT id="3"><B>-yoff </B><I>Y</I>
<DD>
These options position the overlay image with respect to the underlying
image.
<I>X</I>
and
<I>Y</I>
are the horizontal and vertical displacements of the top left corner of
the overlay image from the top left corner of the underlying image, in
pixels. A positive value means right or down; a negative value means
left or up. The overlay need not fit entirely (or at all) on the
underlying image.
<B>pnmcomp</B>
uses only the parts that lie over the underlying image.
<DT id="4"><B>-align=</B>[<B>left</B>,<B>center</B>,<B>right</B>]
<DD>
This option is an alternative to
<B>-xoff</B>,
in the style of HTML. It selects the horizontal position of the overlay
image so that it is flush left, centered, or flush right on the underlying
image.
<DT id="5"><B>-valign=</B>[<B>top</B>,<B>middle</B>,<B>bottom</B>]
<DD>
This option is an alternative to
<B>-yoff</B>,
in the style of HTML. It selects the vertical position of the overlay
image so that it is flush top, centered, or flush bottom on the underlying
image.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+ppmmix">ppmmix</A></B>(1)
and
<B><A HREF="/cgi-bin/man/man2html?1+pnmpaste">pnmpaste</A></B>(1)
are simpler, less general versions of the same tool.
<P>
<B><A HREF="/cgi-bin/man/man2html?5+pnm">pnm</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?1+pbmmask">pbmmask</A></B>(1)
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>
Copyright (C) 1992 by David Koblas (<A HREF="mailto:koblas@mips.com">koblas@mips.com</A>).
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="10"><A HREF="#lbAF">SEE ALSO</A><DD>
<DT id="11"><A HREF="#lbAG">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:23 GMT, March 31, 2021
</BODY>
</HTML>