UFRaw - Unidentified Flying Raw
A utility to read and manipulate raw images from digital cameras
http://ufraw.sourceforge.net/
by Udi Fuchs

UFRaw is a utility to read and manipulate raw images from digital cameras.
It can be used by itself or as a GIMP plug-in.
It reads raw images using Dave Coffin's raw conversion utility DCRaw.
It supports basic color management using Little CMS, allowing the user to
apply color profiles.

UFRaw was originally based on the GIMP plug-in by Dave Coffin
http://www.cybercom.net/~dcoffin/
and on Pawel T. Jochym's (jochym at ifj edu pl) GIMP plug-in.

UFRaw is licensed under the GNU General Public License version 2 or later.

Terminology
===========
This document uses the (Linux) term "development package" to denote
that not only must a program be installed so that it can be run
(binaries, shared libraries), but also so that other programs can be
compiled against it (include files, static libraries). Many Linux
packaging systems split programs into a regular and development
package along these lines. Other packaging systems, such as pkgsrc,
generally have a single package that includes the entire program,
including header files.

Installation
============
(If building from CVS rather than a release see also "Building UFRaw
from CVS", below.)

Building UFRaw requires development packages for GLib >= 2.12 and lcms2.
There are many optional dependencies which enable building additional
programs and adding features to existing programs.

The UFRaw build process expects Perl to be present (for pod2man). It is
needed only if you are changing ufraw.pod or if you are building from CVS.

A modern make is required. GNU make and BSD make both work currently.
In case of trouble, try GNU make.

Building UFRaw on the PowerPC platform requires GCC version 3.4 or newer.

The first step of the installation is to run the configure script:

./configure

At the end of the configuration you will get a summary of the
installation settings. If all optional dependencies are present it
will look like this:

configure: ====================== summary =====================
configure: build GTK GUI: yes
configure: build GIMP plug-in: yes
configure: EXIF support using exiv2: yes
configure: JPEG support: yes
configure: JPEG2000 (libjasper) support: yes
configure: TIFF support: yes
configure: PNG support: yes
configure: FITS support: yes
configure: gzip compressed raw support: yes
configure: bzip2 compressed raw support: yes
configure: lens defects correction support using lensfun: yes

If some of the lines end with 'no' instead of 'yes', UFRaw can still
be built, but the named option will be disabled.

Development packages for GTK+ version 2.12 or higher and
GtkImageView version 1.6 or higher are required for the GUI.

Development packages for GIMP version 2.2 or higher is required to build
the GIMP plug-in.

The development package for exiv2 version 0.20 or higher is required for
reading the EXIF data. Among the supported formats are Canon (CRW, CR2),
Fuji (RAF), Minolta (MRW), Nikon (NEF), Pentax (PEF), Samsung (PEF),
Sony (SR2, ARW) and Adobe's DNG. If the configuration script does not find
this package EXIF support will be omitted.

The libjpeg development package is required for saving image in the
JPEG format in the stand-alone tool. It is also needed to support
Kodak DC120 and Adobe's lossy DNG. If the configuration script does not
find this package JPEG support will be omitted.

The libjasper development package is required to support image files from
Red movie cameras. If the configuration script does not find this package
support for such image files will be omitted.

The libtiff development package is required for saving images in the
TIFF format. If the configuration script does not find this package
TIFF support will be omitted.

The zlib development package is required for saving images in the TIFF
format with lossless compression. If the configuration script does not
find this package compressed TIFF support will be omitted. This pacakage
also enables loading of raw files compressed with gzip.

The libbz2 development package is required for loading of raw
files compressed with bzip2.

UFRaw is written in both C and C++, so if you set CFLAGS you should
also set CXXFLAGS. If you do not set them, then the default for
GNU C is "-W -Wall -g -O3 -fomit-frame-pointer".

Other options for the configuration script are:

--disable-openmp: don't try to use OpenMP support even if it is
		  apparently present.

--enable-extras: build the extra binaries - dcraw, nikon-curve.

--enable-mime: install mime files (see mime section later on).

--enable-dst-correction: enable DST correction for file timestamps.

--enable-contrast: enable the contrast setting option.

--enable-interp-none: enable 'None' interpolation (mostly for debugging).

--enable-valgrind: enable debugging with valgrind

--with-prefix=PREFIX: use also PREFIX as input prefix for the build.

--enable-no-cygwin: add the -mno-cygwin flag to CFLAGS and CXXFLAGS
                    (only in Windows).

--with-dosprefix=PREFIX: PREFIX is the prefix in DOS format
                         (needed only in Windows).

To build UFRaw:
  make

To make a system wide installation:
  make install

Note that the GIMP plugin, if built, will be installed into UFRaw's prefix.
Thus, if UFRaw's prefix is different from GIMP's prefix, you may have to add
the plugin directory to the search path, add a symbolic link, or something
similar.

To use the UFRaw GIMP plugin, ensure that other raw converters
(e.g. rawphoto) are not installed because they may claim the raw file
first, preventing UFRaw from running.

If one of the packages (lcms2, libjpeg, libtiff, zlib etc.) is not installed
on your system, and you can not install it using the normal packaging
system, you can build it locally and use UFRaw's configuration option
--with-prefix to point to its location.  To build any of the above
packages download the package and type:
  ./configure --prefix=$PREFIX
  make
  make install
If zlib is built only locally you will have to configure libtiff with
the command:
./configure --prefix=$PREFIX --with-zlib-include-dir=$PREFIX/include --with-zlib-lib-dir=$PREFIX/lib

Finally, you should configure UFRaw with the command:
./configure --prefix=$PREFIX --with-prefix=$PREFIX

Install mime files
==================
Your desktop can automatically generate thumbnails to raw files and
associate them with UFRaw by installing some mime file. To enable this
option you need to use the configuration option '--enable-mime'.
This options is limited to the GNOME desktop at the moment.

The file ufraw-mime.xml is already part of shared-mime-info 0.21.
If you are using an older version of this package, you should:

cp ufraw-mime.xml /usr/share/mime/packages/

To finish the installation you should use the following
(assuming you are using --prefix=/usr):

# Associate mime type to raw images:
$ (only needed if you are using shared-mime-info < 0.21)
update-mime-database /usr/share/mime
# Install UFRaw's thumbnails generator:
GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule /usr/share/gconf/schemas/ufraw.schemas
# Associate UFRaw with the raw images mime types:
update-desktop-database

More information can be found at:
http://www.chauveau-central.net/page/c_raw.html
http://www.penguin.cz/~utx/gnome-dcraw

MS-Windows installation
=======================
Windows users can simply download ufraw-VERSION-setup.exe that automatically
installs UFRaw.

Here are a few pointers if you still want to build UFRaw yourself.

'make install' will try to make a Unix like installation into /usr/local.
'make windows-installer' will create a Windows installer and
'make install-windows' will run this installer.

For creating the installer UFRaw needs to know the path to all the DLLs.
For this you should use the configuration option --with-dosprefix.
For example, from CygWin:
./configure --with-prefix=/cygdrive/c/mingw32  --with-dosprefix=c:\\mingw32 \
    --target=i686-mingw32msvc --host=i686-mingw32msvc --build=i686-mingw32msvc

pkg-config behaves differently under MinGW32. Therefore, if you are
cross-compiling from Linux or CygWin, you will have to modify all the
*.pc files that come with the different packages. The following script
should do the trick in Debian (update TARGET to your needs):

TARGET=/opt/i586-mingw32msvc
for f in $TARGET/lib/pkgconfig/*.pc ; do
  cat $f | sed s+^prefix=.*+prefix=$TARGET+ > $f.tmp
  mv $f.tmp $f
done

The gimp-dev package can be tricky to find. You can download it from:
http://www.gimp.org/win32/gimp-dev-2.2.7.zip

To build Cygwin binaries you can use the development libraries from:
http://cygwinports.dotsrc.org/

Building UFRaw from CVS
=======================
The development version has the following caveats:

autoconf (version 2.57 or higher) and automake (version 1.5 or higher) must be
installed.

./autogen.sh must be run before ./configure.

The format of the ID files and of the configuration file $HOME/.ufrawrc
may and will change before the final release. I try to make sure that the
new releases will read such files correctly even if they are from previous
releases. No attempt is made to keep backward compatibility with the different
stages of the development versions. If you use the development version you
might have to delete or fix manually such files from time to time.

Last but not least, the development version is poorly tested and has some
half written features, therefore it is bound to have bugs...

Source control of UFRaw via CVS
===============================
UFRaw has a CVS repository on sourceforge.

Using the CVS, new versions of dcraw.c can be easily updated. Copy the latest
version of dcraw.c from Dave Coffin to a UFRaw working directory with the
filename dcraw.cc. Then type:

cvs update -r dcraw-original-branch dcraw.cc
cvs commit -m "dcraw original 7.86 (1.304)." dcraw.cc
cvs update -A
cvs update -j dcraw-original-latest -j dcraw-original-branch dcraw.cc
cvs commit -m "dcraw modified 7.86 (1.304)." dcraw.cc
cvs tag -F -r dcraw-original-branch dcraw-original-latest dcraw.cc

This would commit the original dcraw.cc to the dcraw-original-branch and
update the modified dcraw.cc in the main trunk. Remember to use the correct
version (7.86 in the example) and revision (1.304 in the example) numbers.

This update procedure is not foolproof. First there can be conflicts that
have to be resolved. But even if there are no conflicts, one should check
if there are new global variables or functions and add them to dcraw.h.
One should also check if there where changes to the functions hat_transform(),
wavelet_denoise(), scale_colors(), pre_interpolate(), border_interpolate(),
lin_interpolate(), vng_interpolate(), ppg_interpolate(), cielab(),
xtrans_interpolate(), ahd_interpolate(), convert_to_rgb(), fuji_rotate() or
main(). Such changes could affect dcraw_indi.c or dcraw_api.cc.

For Packagers
=============
You are free to package UFRaw in any way, as long as it complies with the
GNU GPL. The followings are just recommendations.

Do not package the executables generated by by --enable-extras. These extras
are there for testing the code during development. They are of no interest
to end user. Specifically, if you want to package dcraw, you should use
Dave's original code and not UFRaw's modified code.

Notice also that the UFRaw executables have different dependencies.
* ufraw-gimp depends on libgimp and all its derivatives.
* ufraw only depends on libgtk and its derivatives.
* ufraw-batch only depends on glib.
In addition all the executables may depend on lcms2, libjpeg, libtiff, zlib,
exiv2 and lensfun, depending on the way you configured UFRaw's build.

Lastly, I'm requesting that you should consider adding a link to
http://ufraw.sourceforge.net/ where ever is appropriate on the package page.
This site is the main source of information about UFRaw, including an up to
date user guide.

History
=======

16/06/2015 - UFRaw-0.22 released, based on DCRaw v 9.26.

* Fix security issue CVE-2015-3885.
* Removal of liblcms1 support.
* Better Foveon support.
* Lot of new camera support and bug fixes.

10/02/2015 - UFRaw-0.21 released, based on DCRaw v 9.23.

* Bug fix release.

24/09/2014 - UFRaw-0.20 released, based on DCRaw v 9.22.

* Fuji X-Trans filters are finally supported.

25/03/2013 - UFRaw-0.19.2 released, based on DCRaw v 9.17.

* Bug fix release.

07/03/2013 - UFRaw-0.19.1 released, based on DCRaw v 9.17.

* Fix crash triggered by compiler optimization.

26/02/2013 - UFRaw-0.19 released, based on DCRaw v 9.17.

* Maintenance release with lots of bug fixes.

20/02/2011 - UFRaw-0.18 released, based on DCRaw v 9.06.

* New Traditional Chinese translation by Tetralet.
* Port UFRaw to OpenSolaris. Patch by James Lee.

01/04/2010 - UFRaw-0.17 released, based on DCRaw v 8.99.

* Lens distortion corrections using lenfun. This feature is now fully
  implemented and enabled by default.
* Added a despeckling/denoising algorithm to solve issues with images taken
  under very difficult lighting conditions, like deep sea diving.
  It may be useful in other situations too. Patch by Frank van Maarseveen.
* Enabled hot pixel elimination by default.
* Calculate live histogram from working color-space instead of display
  color-space. Calculate live histogram from cropped area only.
  Based on patches by Konrad.
* Added auto-crop option.
* Allow upto 400% zoom.

15/10/2009 - UFRaw-0.16 released, based on DCRaw v 8.98.

* New German translation by Matthias Urlichs and Chris Leick.
* New Simplified Chinese translation.
* Added --with-gtk configuration option to make GTK optional.
* When GTK is used, the GtkImageView library is mandatory.
* Added lightness adjustments by hue. Based on patch by Bruce Guenter.
* Added --color-smoothing command line switch.
* Added --maximize-window command line switch.
* Configurable frame lines overlay. Patch by Bruce Guenter.
* OpenMP support for preview redrawing. Patch by Bruce Guenter.
* OpenMP support for VNG interpolation. Patch by Bruce Guenter.
* Added rotation control to the transformations page of the GUI.
  Patch by Frank van Maarseveen.
* Initial implementation of 100% preview. Based on patches
  by Frank van Maarseveen.
* Added support for hot pixel elimination. It is an experimental feature
  enabled by the configuration switch --enable-hotpixels.
  Based on patch by Frank van Maarseveen.

24/12/2008 - UFRaw-0.15 released, based on DCRaw v 8.89.

* Multiprocessing support using OpenMP. Patch by Bruce Guenter.
* Add progress report during the loading of raw files.
* Add JPEG optimization to reduce the file size without effecting image quality.
* Compatibility with the just released Exiv2-0.18.
* Support sRAW1 and sRAW2 formats of the Canon 50D and 5D Mark II.
* Some annoying bugs got squashed.

19/10/2008 - UFRaw-0.14.1 release, based on DCRaw v 8.88.

* Fix the "Send to Gimp" option to work with Gimp-2.6 that no longer ships
  the remote-gimp command.
* Output and Display intents where switched when a proofing transformation was
  used.

16/10/2008 - UFRaw-0.14 release, based on DCRaw v 8.88.

* Change license from 'GPLv2' to 'GPLv2 or later'.
* Move save-as dialog controls to main window.
* Add a 'remember output path' option.
* Grayscale conversion. Patch by Bruce Guenter.
* Experimental lensfun support. Patch by  Andrew Zabolotny.
  Enable with './configure --with-lensfun'.
  Read http://ufraw.sourceforge.net/lensfun.html before using it.
* Experimental contrast adjustment. Patch by Bruce Guenter.
  Enabled with './configure --enable-contrast'.
* Added --enable-dst-correction configuration option to use local time
  (with DST) for file timestamps.
* Arbitrary rotation support for ufraw-batch. Patch by Martin Ling.
* Write EXIF data to TIFF files. Requires the soon to be released Exiv2-0.18.
* Load private resource file $HOME/.ufraw-gtkrc at startup.
* Replace the "use matrix" check box with a "Color matrix" profile.
  Patch by Rafael Espindola.
* Remove misleading or irrelevant EXIF fields. Patch by Martin Ling.
* Added --rotate=no to ufraw-batch. This is useful for creating
  contact sheets. Patch by Serge Droz.
* Improved auto-exposure/black/curve tools by using normalized raw histogram
  instead of raw luminosity histogram.
* For JPEG output, 2x2 sampling for the chrominance components was used by
  default. Now for compression>90 we use 2x1 sampling and for
  compression>92 we use 1x1  sampling.
* Use predictor value 2 when saving deflated TIFFs for much better compression.
* New Swedish translation by Daniel Nylander.
* New Czech translation by Milan Knizek.
* New Italian translation by Daniele Medri.
* New Dutch translation by Simon Oosthoek.
* New Norwegian translation by Alvin Brattli.
* New Serbian translation (Cyrillic and Latin) by Milos Popovic.
* New Catalan translation by Paco Riviere.

12/11/2007 - UFRaw-0.13 release, based on DCRaw v 8.80.

* Simplified output path logic - output path defaults to the path of the
  input path.
* Added 'System profile' option to read display ICC profile from the X display.
  Based on code from Gimp.
* Do not read/write display ICC profile from/to ID files.
* Show camera white balance in EXIF page. Patch by Erik Burrows.
* Automatically fit histograms to allocated height.
* Read Canon lens from EXIF data. Patch by Andreas Steinel.
* Improved PPG interpolation. Patch by Alain Desbiolles.
* Remember maximized state of window between sessions.
* Add color smoothing option to all interpolation. Based on patch by alexander
  melkozerov. AHD+smoothing is exactly the same as the now obsolete EAHD.
* Added darkframe to GUI (patch by Bruce Guenter).
* Darkframe subtraction also handles hot pixels (patch by Bruce Guenter).
* Show spot values only if spot is selected and allow unselecting spot values.
* Add FITS output. Patch by Andreas Steinel. This option is disabled by default.
* Progressive JPEG encoding. Patch by Bruce Guenter.
* Blink over/under exposure in preview. Patch by Bruce Guenter.
* Enable --output option for stand-alone tool. It forces the output filename
  to the value specified. It is useful for F-Spot. Patch by Stephane Delcroix.
* Reimplemented the EXIF page. Patch by Andrew Zabolotny.
* Display flash mode in EXIF page.
* Moved shrink/size controls from Save dialog to main window.
* Added delete button to stand-alone tool.
* Added 'send to Gimp' option to stand-alone tool.
* Made the save-as button an icon only, to save space.
* Added option to save as PNG 8 or 16 bits.
* Write EXIF data to PNG files. Based on code from DigiKam.
* Added aspect ratio control. Patch by Andrew Zabolotny.
* New Spanish translation by Enrique Jorreto Ledesma.
* New Polish translation by Tomasz Golinski.
* New Korean translation by Homin Lee.

10/08/2007 - UFRaw-0.12.1 release, based on DCRaw v 8.77.

* Fixed handling of non integer shrink factors.
* Fixed crash when spot selector reached image boundary.
* Some TIFF images were wrongly identified as raw file.

30/07/2007 - UFRaw-0.12 released, based on DCRaw v 8.77.

* Full color management workflow with camera, display and output profiles.
* Added image cropping. Patch contributed by Martin Ling.
* Added rotate/flip support. Patch contributed by Bruce Guenter.
* Added scrolling and panning. Based on the new GtkImageView widget by
  Bjoern Lindqvist.
* Added support for dcraw's wavelet denoising. Code contributed by
  Niels Kristian Bech Jensen.
* Added Patterned Pixel Grouping (PPG) Interpolation. It can be even better
  than other interpolations in some cases and much faster. Patch contributed
  by Alain Desbiolles.
* Added EAHD interpolation. It is an enhancement of the AHD interpolation
  with another phase of color smoothing. The improvement is mostly seen in
  high contrast as it removes color artifacts such as chromatic aberration.
  Patch contributed by Michael Goertz.
* Read raw files compressed with gzip or bzip2. Patch contributed by
  Bruce Guenter.
* Display luminosity value and Adams' zone for spot value. Patch contributed by
  Greg Troxel.
* Added 'max zoom' (only 50% at the moment) and 'zoom to fit' buttons.
* Retain some hue and saturation when clipping pixels. This is only relevant
  when applying positive exposure compensation, and mostly for Canon cameras
  where positive exposure is applied by default.
* Added a Cinepaint plug-in. Thanks to Cinepaint developer Kai-Uwe Behrmann.
* Based the user interface more on icons and less on text.
* Removed dependency on libexif.
* Dozens of smaller fixes.

06/03/2007 - UFRaw-0.11 released, based on DCRaw v 8.62.

* Add option to restore highlights. The restoration can be done either
  in HSV space giving sharp details or in LCH space giving soft natural details.
  This option is relevant when applying negative exposure correction in UFRaw.
* Add option for soft, filmlike clipping of highlights.
  This option is relevant when applying positive exposure correction in UFRaw.
* Give the correct camera exposure by default for Canon DSLRs.
  Until now raw images from these cameras came out under exposed.
* For Windows users, fix conflict with the liblcms-1.dll supplied
  with the Gimp windows instaler.
* Added translation to Danish, Japanese and Portuguese.

26/10/2006 - UFRaw-0.10 released, based on DCRaw v 8.41.
* Apply luminosity curve and saturation corrections in LCH(ab) space.
* Add the '--embedded-image' option to ufraw-batch for reading the
  embedded preview image in raw files.
* Use the above code in the Gimp plug-in for a much quicker generation
  of the preview thumbnails.
* Add mime types to recognize raw files in the Gnome desktop.
* Add schemas to generate thumbnails for these mime types.
* Modify the desktop entry to associate ufraw with these mime types.
* If 'save ID' is set to 'never again' then .ufrawrc is not written
  after each processed image.
* Add a 'Cancel' button to the 'Options' window.
* Fix compatibility issues with GTK+ 2.10.
* When handling ID files save output image in same directory as ID file.
* If input and output filenames in the ID file have the same path,
  then input filename is searched for in the path of the ID file.
  This allows moving raw and ID files together between folders.
* Add translations to French and Russian.
* Some bug corrections.

12/08/2006 - UFRaw-0.9.1 released, based on DCRaw v8.29.
* Recognize Sony's *.arw file type.
* Redirect exiv2 warnings from the terminal to the log.
* Fix build for some build environments (libjpeg errors).
* Treat Minolta's Alpha and Maxxum models as the Dynax model for WB presets.

03/08/2006 - UFRaw-0.9 released, based on DCRaw v8.28.
* Display EXIF data in user interface.
* Add darkframe subtraction option.
* More conservative highlight unclipping.
* Support filenames in URI format.
* Some bug corrections.

13/05/2006 - UFRaw-0.8.1 released, based on DCRaw v8.15.
* Fix Gimp plug-in half-interpolation crash.
* Fix possible crash in auto-exposure.

04/05/2006 - UFRaw-0.8 released, based on DCRaw v8.13.
* Preliminary zoom support, only up to 50% and with no scrolling.
* Auto white balance is much faster.
* Auto exposure is smarter, and hopefully better.
* Auto black and auto curve are much faster.
* EXIF data of Canon CRW files can be read using Exiv2 (not enabled by default).
* EXIF data of Fuji RAF files can be read using libexif (not enabled by default).
* White balance presets for more cameras.
* Fix the bug that sometimes caused a 'maze effect'.
* A few minor bug fixes.

03/03/2006 - UFRaw-0.7 released, based on DCRaw v8.05.
* Much more accurate white balance temperature setting.
* White balance presets per camera model.
* Show the channel multipliers in the UI.
* Apply base curve before gamma curve.
* Fix a few general bugs.
* Fix camera specific bugs for Sony F828, Sigma Foveon, Nikon D2H, D1X.

13/11/2005 - UFRaw-0.6 released, based on DCRaw v7.84.
* Enabled AHD (Adaptive Homogeneity-Directed) interpolation.
* Added base curve, which simulates Nikon tone curve behavior.
  (The old correction curve is still there.)
* Automatically apply the embedded custom curve only if the camera
  was setup to use this curve.
* Support the D1X rectangular pixels.
* Fix EXIF support with libtiff 3.7.4.
* Some bug fixes.

25/09/2005 - UFRaw-0.5 released, based on DCRaw v7.65.
* Read support for Nikon Tone Curve (NTC/NCV) files.
* Added a curve editor.
* Added control on the base curve (see the user guide for more information).
* Support the new DCRaw color matrices for better color rendering.
* More controls can be set from the command-line.
* Preliminary EXIF support.
* New UFRaw ID files contain all the conversion parameters and allow
  for batch conversion.
* New 'ufraw-batch' replaces 'ufraw --batch'.
* Numerous other changes.
* Notice that the new Adaptive Homogeneity-Directed interpolation
  is still not enabled.

08/02/2005 - UFRaw-0.4 released, based on DCRaw v6.33.
* Rotate Fuji images by 45 degrees.
* Preview dialog is more responsive.
* Disable internationalization for Hebrew and Arabic (The right to left setting
  doesn't do good to the preview dialog).
* Bug correction - ufraw --batch did not calculate WB in some cases.
* Bug correction - Seg Fault for some images.

23/01/2005 - UFRaw-0.3 released, based on DCRaw v6.23.
* Added basic color management support using Little CMS.
* Made a stand-alone version with a GUI interface and batch processing support.
  Images can be saved in the PPM, TIFF, and JPEG formats.
* Settings are saved between sessions in a configuration file.
* Added white balance presets (direct sunlight, cloudy, shade, flash, etc.)
* Several possible live histograms.
* Initial (a bit slow) support for thumbnails in the GIMP 2.0 open file dialog.
* Many smaller changes.

28/10/2004 - UFRaw-0.2 released, based on DCRaw v6.10.
* Added support for Nikon Tone Curves.
* This version can be used on the smaller 1024x768 screens.
* I'm finally satisfied with the Saturation control.
* Many small changes.

11/10/2004 - UFRaw-0.1 released, based on DCRaw v6.07.
* Initial version.
