Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > by-pkgid > bbb305e6fb2f4e8ebc72959c802137bf > files > 21

dcraw-8.93-1mdv2009.1.src.rpm

<HTML>
<TITLE>Secrets of the PowerShot 600</TITLE>

<CENTER>
<H1>Secrets of the PowerShot 600</H1>
</CENTER>

<BODY>

<h2>File Structure</h2>

The ATA hard disks and flash cards must be DOS-formatted
prior to use.  The camera creates a <tt>/pwrshot/ctg_0000</tt>
subdirectory and stores the following file types within:
<p>
<center>
<table border>
<tr>
  <th align=left>*.ctg
  <th align=left>Catalog files used by the download software
</tr>
<tr>
  <th align=left>*.tif
  <th align=left>80x60 Thumbnail images (15K each)
</tr>	
<tr>
  <th align=left>*.crw
  <th align=left>Raw CCD pixel dumps (672K each)
</tr>	
<tr>
  <th align=left>*.jpg
  <th align=left>JPEG images (size varies)
</tr>	
<tr>
  <th align=left>*.wav
  <th align=left>Sound annotations (about 8K per second)
</tr>	
</table>
</center>

<P>
     <tt>ctg_0000</tt> will not contain more than 100 files.
When it's "full", the camera creates <tt>ctg_0001</tt>, 
<tt>ctg_0002</tt>, etc.

<H2>WAV Files</H2>
<P>
     To play the sound annotations, install the
<A HREF="http://home.sprynet.com/~cbagwell/sox.html">SoX</A>
utility and do:
<pre>
	sox aut_0035.wav -t au /dev/audio
</pre>
<P>
Flash cards record silently, but hard disks make whirring
and clicking noises that are picked up by the microphone.

<H2>JPEG Files</H2>

JFIF/JPEG is a free image format for lossy compression of
photographic images.  See
<A HREF="ftp://ftp.uu.net/graphics/jpeg">the JFIF source code</A>
for details.
<P>
When converting a 24-bit image to JPEG, you must specify
a quality parameter from 0 to 100.  A lower setting produces
a smaller JPEG file, but also makes the JPEG artifacts more
obvious.  The PowerShot provides three quality settings:
"Economy" 30, "Normal" 70, and "Fine" 90.
<P>
The camera's CCD pixels are not exactly square.  To correct
this, you must resize the image from 832x608 to 832x624.

<H2>Info Blocks</H2>

Each image file contains an Info Block, with such data as
exposure settings, time stamp, etc.  In JPEG files, it's
near the beginning (most image viewers will discard it).
In CRW files, it's at the end.
<p>
<a href="fixdates.c">fixdates.c</a> will find the timestamp
and re-date the file to match.  Very simple, since the time
is already stored in UNIX format!
<p>
I plan to explore Info Blocks in more detail later...

<H2>CRW Files</H2>

First off, a CRW file is <b>not</b> a 1.5 MB 24-bit TIFF,
although it does have a TIFF header.  It <b>is</b> a 672K
raw dump of the CCD pixels, with no compression.  To read
CRW, you must understand the hardware that produced it.
<p>
     The PowerShot 600 CCD has 523,502 pixels arranged in
854 columns by 613 rows.  Each pixel returns a 10-bit
intensity value.  The manual claims 570,000 pixels, but
offers no further details. 
<p>
     The pixel grid is covered by a mosaic of color filters.
Under a microscope, the filters would look like this:

<table>
<tr>
<th>
<p>
<a href="filter.gif">
<img src="filter.gif" width=288 height=216 border=2 align=left alt="GMCY Array">
</a>
<th>
<table border>
<tr>
<th colspan=3>Primary RGB colors
</tr>
<tr><th>red<th>green<th>blue</tr>
<tr><td align=right>11<td align=right>86<td align=right> 8<th>green
<th rowspan=4>CCD filters</tr>
<tr><td align=right>50<td align=right>29<td align=right>51<th>magenta</tr>
<tr><td align=right>11<td align=right>92<td align=right>75<th>cyan</tr>
<tr><td align=right>81<td align=right>98<td align=right> 8<th>yellow</tr>
</table>
<p>
<table border>
<tr><th rowspan=3>Key:</tr>
<tr><td align=right>  0<td align=left>totally opaque</tr>
<tr><td align=right>100<td align=left>totally transparent</tr>
</table>
</table>

<br>
<p>
Red, green and blue can't be derived from a single CCD pixel;
they must be interpolated from the surrounding pixels.
As of version 0.86, this is a five-step process:
<p>
<li>  Parse the CRW file and extract the pixel values.
<li>  Interpolate them to produce green, magenta, cyan, and yellow
values for every non-edge pixel (thus the output will be 852x611).
<li>  Interpolate again to smooth out the color ratios.
<li>  Compute RGB for each pixel to collect statistics.
<li>  Compute RGB again, applying gamma correction and other
adjustments.
<p>
Users may add more steps, such as running a sharpen filter and
resizing the image to 852x627.

<h2>Using the Docking Station</h2>

I haven't tried to do this from Linux.  It's only necessary for
setting the camera's clock.

<h2>Canon Support</h2>

Canon provides no developer support for their cameras other than
a Windows-only SDK.

<p>
<a href="index.html"> Back to the PowerShot 600 Guide </a>
</html>