<!-- Converted by db4-upgrade version 1.0 -->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="bwscale1">

<refmeta>
  <refentrytitle>BWSCALE</refentrytitle>
  <manvolnum>1</manvolnum>
  <refmiscinfo class="source">BRL-CAD</refmiscinfo>
  <refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
</refmeta>

<refnamediv xml:id="name">
  <refname>bwscale</refname>
 <refpurpose>
   change the size of a black and white bw file
 </refpurpose>
</refnamediv>

<!-- body begins here -->
<refsynopsisdiv xml:id="synopsis">
  <cmdsynopsis sepchar=" ">
  <command>bwscale</command>    
    <arg choice="opt" rep="norepeat">-r </arg>
    <arg choice="opt" rep="norepeat">-s <replaceable>squareinsize</replaceable></arg>
    <arg choice="opt" rep="norepeat">-w <replaceable>in_width</replaceable></arg>
    <arg choice="opt" rep="norepeat">-n <replaceable>in_height</replaceable></arg>
    <arg choice="opt" rep="norepeat">-S <replaceable>squareoutsize</replaceable></arg>
    <arg choice="opt" rep="norepeat">-W <replaceable>out_width</replaceable></arg>
    <arg choice="opt" rep="norepeat">-N <replaceable>out_height</replaceable></arg>
    <arg choice="opt" rep="norepeat">-h </arg>
    <arg choice="opt" rep="norepeat"><replaceable>infile.bw</replaceable></arg>
    <arg choice="plain" rep="norepeat"><replaceable>outfile.bw</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>


<refsection xml:id="description"><info><title>DESCRIPTION</title></info>
  
  <para>
    <command>bwscale</command>
    <emphasis remap="I">Bwscale</emphasis>
    will take a black and white
    <citerefentry><refentrytitle>bw</refentrytitle><manvolnum>5</manvolnum></citerefentry>
    format file of given dimensions and produce a larger or smaller
    scaled version.
    The
    <option>-w</option>
    and
    <option>-n</option>
    flags specify the input file width and number of scan lines in pixels.
    They can both be set to the same value via
    <option>-s.</option>
    Similarly, the
    <option>-W</option>
    and
    <option>-N</option>
    flags specify the desired output file width and number of scan lines in
    pixels.  They can both be set to the same value via
    <option>-S.</option>
  Defaults of 512 are assumed for any unspecified dimensions.</para>
  
  <para>
    By default,
    the algorithm used is bilinear interpolation if scaling up, and
    a box filter of arbitrary size if scaling down.  For the box filter a
    "square pixel" assumption is made; that is, all whole and fractional
    input pixels falling into a rectangle the size of an output pixel contribute
    equally according to the fraction of the output pixel area they cover.
    When interpolating, the edge pixels are preserved, i.e., all of the
    interpolated pixels fall inside of the edges.  This can be a bit surprising
    when doubling the size of a file, for example, as only the edge pixels
    will fall at exactly the location of an output pixel.
  </para>
  
  <para>Specifying the
  <option>-r</option>
  flag changes from bilinear interpolation to
  nearest neighbor interpolation, i.e., it enlarges the image by
  pixel replication.</para>
  
  <para>The
  <option>-h</option>
  flag causes the frame buffer to be
  used in high-resolution mode (1024 x 1024).
  This is important for frame buffers such as the Adage which operate
  differently depending on the display size.  Without this flag,
  the default size for the selected device will be used (usually
  the entire screen).</para>
</refsection>

<refsection xml:id="see_also"><info><title>SEE ALSO</title></info>
<para>
  <citerefentry><refentrytitle>brlcad</refentrytitle><manvolnum>1</manvolnum></citerefentry>, 
  <citerefentry><refentrytitle>bwcrop</refentrytitle><manvolnum>1</manvolnum></citerefentry>, 
  <citerefentry><refentrytitle>bwrect</refentrytitle><manvolnum>1</manvolnum></citerefentry>, 
  <citerefentry><refentrytitle>bw</refentrytitle><manvolnum>5</manvolnum></citerefentry>, 
  <citerefentry><refentrytitle>pixscale</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para>
</refsection>

<refsection xml:id="bugs"><info><title>BUGS</title></info>
<para>This program cannot scale up in one dimension and down in the other
at the same time.</para>
<para>
The box filter used for scaling down results in the usual high-frequency
ripple.</para>
<para>
Optional cubic interpolation would be nice.</para>
</refsection>

<info><corpauthor>BRL-CAD Team</corpauthor></info>

<refsection xml:id="bug_reports"><info><title>BUG REPORTS</title></info>
<para>Reports of bugs or problems should be submitted via electronic
mail to devs@brlcad.org.</para>
</refsection>
</refentry>
