File: Why-LibRaw-eng.html

package info (click to toggle)
libraw 0.14.6-2%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 5,728 kB
  • sloc: cpp: 14,132; sh: 10,692; ansic: 10,229; makefile: 87
file content (209 lines) | stat: -rw-r--r-- 10,407 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Purpose and Objectives</title>
  </head>

  <body>
    <a href=index-eng.html>[back to Index]</a>
    <h1>LibRaw Project Goals and Objectives</h1>
    <h2>Contents</h2>
    <ol>
      <li><a href="#audience">Who May Be Interested in This Project</a></li>
      <li><a href="#goals">Goals and Objectives</a></li>
      <li><a href="#support">LibRaw Support Principles</a></li>
      <li><a href="#better">Implemented Improvements of dcraw</a></li>
      <li><a href="#todo">Planned Improvements</a></li>
    </ol>
    
    <a name="audience"></a>
    <h2>Who May Be Interested in This Project</h2>
    <p>The proposed project and the software products generated within this project are intended for</p>
    <ul>
      <li>Developers of RAW converters, including current and new developments</li>
      <li>Those willing to write their own graphic interface for RAW file processing</li>
      <li>Developers and enthusiasts creating their own primary and auxiliary data processing algorithms,
including
        <ul>
          <li>Interpolation (de-Bayer),</li>
          <li>Noise reduction</li>
          <li>White balance</li>
          <li>Correction of aberrations and distortions</li>
          <li>Color conversions (e.g., creation, editing and application of camera profiles )</li>
          <li>RAW data analysis</li>
          <li>Comparison of cameras and lenses</li>
          <li>and so on...</li>
        </ul>
      </li>
      </ul>
    <p>Among the few existing implementations of RAW converters, those based on the 
      <A  HREF="http://cybercom.net/~dcoffin/dcraw/">dcraw</A> utility by Dave Coffin are the most used.
It is hard to find a more or less popular camera that is not supported by this 
utility; while the implementation of RAW data extraction in dcraw is of
a very high quality.
    </p>
    <P>However, developers and enthusiasts who use or are going to use dcraw for
 	fulfilling the above-listed and similar objectives encounter a
	number of difficulties. First, the author of dcraw refuses to turn his
	product into a handy library, yet permitting anybody else to do so.
	Besides, dcraw contains a number of questionable features which may
	hinder its use without modifications, as well as instances of
	distortions in the photographic sense of it. As a result, once every
	several months, virtually all developers, part of them listed on the
    	dcraw Web site, independently convert each subsequent release of the
   	software into the library.
	</p>
    <p>
        As for enthusiasts, the "entry cost" of verifying their own ideas and
        implementing their own algorithms is often unreasonably high: they have
        to either use the dcraw command line, thus being forced to use the
        unavoidable early processing stages, or understand the source code and
        maintain their own library based on it.
    </p>
    <p>
        Thus, the inconveniences of dcraw make the developers' community quite
        small and halt further evolution and improvement of RAW format
        converters.
     </p>
    <a name="goals"></a>
    <h2>Goals and Objectives</h2>
    <p>We are going to create LibRaw in order to &quot;<b>get a library based on dcraw, only better</b>&quot;. Thus:
    </p>
    <ol>
      <li>To &quot;librarize&quot; dcraw, i.e., to develop a stable and consistent API suitable for other applications
  (RAW converters, data analyzers, panorama stitchers, etc.).
      </li>
      <li>To divide processing into independent parts (groups of API calls)
        <ul>
          <li> Reading, decoding, and unpacking of RAW data: <b>this is the main functionality of LibRaw</b></li>
          <li> Data conversions: interpolation, white balance, etc.</li>
          <li> File output of the processing results.</li>
        </ul>
        The latter two groups of functions are maintained primarily for dcraw  compatibility testing.
      </li>
      <li>To improve the procedures of RAW data retrieval and decoding (see below for details)
      </li>
      <li>To supply other developers with a &quot;framework&quot; (freeware and open-source), e.g.,
for experimenting with their own methods of RAW data processing 
(interpolation, noise reduction, white balance, etc.; some directions
of the possible efforts are <a href="#audience">listed above</a>), 
so that they could create their own GUI programs and interfaces without developing the entire RAW converter.</li>
      <li>To ensure easy modification for code synchronization with dcraw releases.</li>
    </ol>

    <a name="support"></a>
    <h2>LibRaw Support Principles</h2>
      <ol>
      <li>To reproduce the functionality of dcraw using its source code as the basis for our work; to
achieve binary identity of results generated by dcraw and by LibRaw-based utilities, provided the same processing settings are used.
      </li>
      <li>To eliminate the shortcomings of dcraw (see sections 
<a href="#better">Implemented Improvements of dcraw</a> and <a  href="#todo">Planned Improvements</a>).
      </li>
      <li>To monitor future improvements in dcraw (support of new cameras,  error correction, 
use of better algorithms) and import them from dcraw to LibRaw.
      </li>
      <li>API modifications: the <a href="#todo">planned improvements</a> will <b>require</b> extending
of the API. Such changes will be introduced in the form of large change-sets, 
while the compatibility mode supporting older
        applications based on the legacy API set will be preserved as long
        as possible.
      </li>
      </ol>

    <a name="better"></a>
    <h2>Implemented Improvements of  dcraw</h2>
    <p>
    As of the time of writing, additional improvements to the dcraw source
       code have been introduced into LibRaw:
	</p>
    <ul>
      <li>
        All global variables have been removed (while linking the
              thread-safe version, static variables of functions have been
              removed as well).
      </li>
      <li>Thread safety. An example of its use in the multithreaded model is included into the library distribution package.
      </li>
      <li>
      Data extracted from a RAW file is already somewhat structured:
      geometry is separated from color data.
        <i>This work has not yet been completed; it will be continued simultaneously with the
<a href="#todo">work on improvement of EXIF processing</a></i>.
      </li> 
      <li>Retrieval of RAW data and thumbnail can be performed in two or three API calls with a very simple
        program interface.
      </li> 
      <li>Work with color information: color data (white balance coefficients, tone curve, etc.) has flags referencing
        the source of this information: retrieved from RAW data, calculated 
        from the image itself, or taken from the code as constants.
      </li>
      <li>ICC profile is extracted (for those RAW files that contain it).</li>
      <li>The image itself and the thumbnail can be retrieved by successive calls, without reopening the file
        or relaunching the library. 
      </li>
      <li>The required amount of RAM is somewhat lower.</li>
      <li><b>Work with black subtraction:</b>: it is possible to turn off black level subtraction.</li>
      <li><b>Processing of the black frame</b>: black subtraction and zero pixel cleaning already can be turned off. 
	Code for accurate black level calculation and banding suppression is planned.
      </li>
      <li>The maximum values may also be nonidentical for different channels; accordingly, these values
        are calculated at the stage of RAW data unpacking and output within the framework of the API. Calculation of
        the maximum values for a given camera sample at a specified sensitivity (converter calibration) is to be done
        in the application that calls LibRaw.
      </li>


    </ul>

    <a name="todo"></a>
    <h2>Planned Improvements</h2>
    <p>The dcraw code needs significant modifications and additions:</p>
    <ul>
      <li><b>Single-pass unpacking of RAW files containing several image variants/planes</b>: for applicable cameras
        (Fuji cameras, cameras with 4-shot/16-shot modes), several planes of the same image will be extracted.
        </li>

      <li><b>Data unpacking verifications for the widest possible set of file formats</b>. According to some studies,
        dcraw does not completely ensure correct unpacking of some data formats.
      </li>

      <li><b>Processing of the EXIF/Makernote</b> data: retrieval of large data amounts, including
        <ul>
          <li>Extraction of the maximum possible amount of color data (white balance settings, 
            profile, tone curve, contrast settings, etc.)</li>

          <li>Color data generalization: reduction of color data from different cameras 
            &quot;to a common denominator&quot; in order to facilitate color processing (without loss of quality)</li>

          <li>Extraction of camera data  (firmware version, serial number)</li>

          <li>Extraction of photographic data (lens used, focusing distance, focus points and their coordinates, etc.)</li>

          <li>Extraction of the bulk EXIF data set without analyzing the structure in order to 
            facilitate copying of that EXIF data to output files.</li>
        </ul>
      </li>
      <li>Generalization of work with complex formats, including
        <ul>
          <li>RAW files from Fuji cameras (with two sets of sensors)</li>
          <li>RAW files from digital backs with 4-shot and 16-shot modes.</li>
        </ul>
      </li>
    </ul>
    <p>At the same time, we are not planning any modifications or extensions of the dcraw data processing code
 (de-Bayer, color conversions, etc.); all of this is up to the calling application. Standard processing modes
     included in dcraw will be preserved for an indefinite time in the set
     of dcraw-emulating API calls, with the exception of LCMS and libjpeg
     support, as well as certain processing stages of minor importance.
    </p>

    <a href=index-eng.html>[back to Index]</a>
    <hr>
    <address><a href="mailto:info@libraw.org">LibRaw Team</a></address>
<!-- Created: Sun Mar 16 09:12:42 MSK 2008 -->
<!-- hhmts start -->
Last modified: Mon Jul 11 20:20:12 MSD 2011
<!-- hhmts end -->
  </body>
</html>