<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='djpegb1'>
<!--  @(#)djpegb.1 2001/04/02 NIST -->
<!--  I Image Group -->
<!--  Craig Watson and Michael D. Garris -->

<refmeta>
<refentrytitle>DJPEGB</refentrytitle>
<manvolnum>1D</manvolnum>
<refmiscinfo class='date'>02 April 2001</refmiscinfo>
<refmiscinfo class='source'>NIST</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>djpegb</refname>
<refpurpose>decompresses a Baseline JPEG (JPEGB) grayscale or color image.</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>djpegb</command>    
    <arg choice='plain'><replaceable>&lt;outext&gt;&lt;imagefile&gt;</replaceable></arg>
    <arg choice='opt'><arg choice='plain'>-raw_out </arg><arg choice='opt'>-nonintrlv </arg></arg>
    <sbr/>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>Djpegb</emphasis>
takes as input a file containing a Baseline JPEG (JPEGB) compressed
grayscale or color image.  Once read into memory, the lossy-compressed
pixmap is decoded and reconstructed using the Independent JPEG Group's
(IJG) library for Baseline JPEG.</para>  

<para>Upon completion, two different output image file formats are possible,
a NIST IHead file (the default) or a raw pixmap file (specified by the
<option>-raw_out</option> flag).  In addition, a specially formatted text
file, called a NISTCOM, is created with extension ".ncm".  The NISTCOM
file contains relevant image attributes associated with the decoded
and reconstructed output image.
(See NISTCOM OUTPUT below.)</para>

</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<para>All switch names may be abbreviated; for example,
<option>-raw_out</option> may be written <option>-r</option>.</para>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&lt;outext&gt;</emphasis></term>
  <listitem>
<para>the extension of the decompressed output file.
To construct the output filename, <command>djpegb</command> takes the
input filename and replaces its extension with the one
specified here.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;image file&gt;</emphasis></term>
  <listitem>
<para>the input JPEGB file to be decompressed.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-raw_out</option></term>
  <listitem>
<para>specifies that the decoded and reconstructed image should be
stored to a raw pixmap file.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-nonintrlv</option></term>
  <listitem>
<para>specifies that the color components in the reconstructed image should
be organized into separate component planes.  The <option>-raw_out</option> flag
must be used with this option, because the IHead format only supports
interleaved color pixels.  (See INTERLEAVE OPTIONS below.)</para>

  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='interleave_options'><title>INTERLEAVE OPTIONS</title>
<para>For example, given an RGB image, its color
components may be interleaved or non-interleaved.  Color components are
interleaved when a pixel's (R)ed, (G)reen, and (B)lue components are
sequentially adjacent in the image byte stream, ie. RGBRGBRGB... .
If the color components are non-interleaved, then all (R)ed components
in the image are sequentially adjacent in the image byte stream, followed
by all (G)reen components, and then lastly followed by all (B)lue
components.  Each complete sequence of color components is called
a <emphasis remap='I'>plane</emphasis>.  The utilities <emphasis remap='B'>intr2not</emphasis> and <emphasis remap='B'>not2intr</emphasis>
convert between interleaved and non-interleaved color components.
By default, <command>djpegb</command> uses interleaved
color component pixels in the reconstructed output image.
Note that all color IHead images must be interleaved.</para>

</refsect1>

<refsect1 id='nistcom_output'><title>NISTCOM OUTPUT</title>
<para>Upon successful completion, <command>djpegb</command>, creates a specially
formatted text file called a NISTCOM file.
A NISTCOM is a text-based attribute list comprised
of (name, value) pairs, one pair per text line.
The first line of a NISTCOM always has name = "NIST_COM" 
and its value is always the total number of attributes included in
the list.  These attributes are collected and merged from two
different sources to represent the history and condition of
the resulting reconstructed image.  The first source is from an
optional NISTCOM comment block inside the JPEGB-encoded input file.
This comment block can be used to hold user-supplied attributes.
The JPEGB encoder, <emphasis remap='B'>cjpegb</emphasis>, by convention inserts one of these
comment blocks in each compressed output file it creates.
(The utility <emphasis remap='B'>rdjpgcom</emphasis> can be used to scan a JPEG file for
any and all comment blocks.)
The second source of attributes comes from the decompression
process itself.  In general, attribute values from this second
source are given precedence over those from the first.</para>

<para>The NISTCOM output filename is constructed by combining the
basename of the input JPEGB file with the extension ".ncm".
By creating the NISTCOM file, relevant attributes associated
with the decoded and reconstructed image are retained and
easily accessed.  This is especially useful when dealing with
raw pixmap files and creating image archives.  The following
is an example NISTCOM generated by <command>djpegb</command>:</para>

<!-- .RS -->
<para>NIST_COM 10
<!-- .br -->
PIX_WIDTH 768
<!-- .br -->
PIX_HEIGHT 1024
<!-- .br -->
PIX_DEPTH 24
<!-- .br -->
PPI -1
<!-- .br -->
LOSSY 1
<!-- .br -->
COLORSPACE RGB
<!-- .br -->
NUM_COMPONENTS 3
<!-- .br -->
HV_FACTORS 1,1:1,1:1,1
<!-- .br -->
INTERLEAVE 1</para>

</refsect1>

<refsect1 id='examples'><title>EXAMPLES</title>
<para>From <emphasis remap='I'>test/imgtools/execs/djpegb/djpegb.src</emphasis>:</para>

<!-- .RS -->
<para><emphasis remap='B'>% djpegb raw face24.jpb -r</emphasis>
<!-- .br -->
decompresses a JPEGB-encoded RGB face image and stores
the reconstructed image to a raw pixmap file.  Note the
NISTCOM file, <emphasis remap='B'>face24.ncm</emphasis>, is also created.</para>

</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para><emphasis remap='B'>cjpegb</emphasis>(1D),
<emphasis remap='B'>dpyimage</emphasis>(1D),
<emphasis remap='B'>intr2not</emphasis>(1D),
<emphasis remap='B'>jpegtran</emphasis>(1E),
<emphasis remap='B'>not2intr</emphasis>(1D),
<emphasis remap='B'>rdjpgcom</emphasis>(1E),
<emphasis remap='B'>wrjpgcom</emphasis>(1E)</para>

</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>NIST/ITL/DIV894/Image Group</para>
</refsect1>
</refentry>

