refinery
RAW file processor
|
Refinery reads RAW photograph files as input and provides usable RGB (or other format) data, which is suitable for combining with other imaging libraries.
git clone git://github.com/adamh/refinery.git
sudo apt-get install libboost-dev cmake
cmake -D CMAKE_BUILD_TYPE=Release .
make
(to change options, install and run ccmake
). sudo make install
This will install headers, a shared library, and the raw2ppm
program.
If you also have SWIG 2.0 and Python development headers installed, then Python bindings will be built and installed. With these, you can combine refinery with the Python Imaging Library (PIL) for image-processing power.
You may also install Exiv2 and run cmake with -D LICENCE_GPL=ON
to compile Exiv2 support. Where the built-in DcrawExifData doesn't work, Exiv2 might.
This is a library, not a program. You can use -I/path/to/refinery
and -lrefinery
to compile programs.
One program, raw2ppm
, accompanies this code. Call it with raw2ppm [RAWFILE] outfile.ppm
. It converts a RAW file to a PPM and is intended as an example, not an everyday tool. You can link refinery with other libraries (such as a JPEG-writing one) to create more powerful tools.
Use -I/path/to/refinery
and -lrefinery
to compile programs. You can include <refinery/refinery.h> for some basic tools, or just include the particular files you need.
Use util/raw2ppm.cc
as an example. There's also util/licensed/gpl/convert.py
which shows how to use Python to extend classes and take advantage of PIL.
Raw decoding entails a series of steps; here's a typical chain:
Depending on your intents, you might want to add more steps. That's okay, since the image data is easy to copy from Image::pixels().
This code is public domain, except for anything that links to Exiv2, which is GPL.