Adam Hooper's Engineering Tips

refinery: a fast RAW decoding library

Don't you hate how long it takes for your computer to import RAW photos?

The de-facto program to convert RAW files to other formats, dcraw, by Dave Coffin, gives great-quality images ... slowly.

Dcraw's author refuses to turn dcraw into a library, saying: "Library code is ugly because it cannot use global variables. Libraries are more difficult to modify, build, install, and test than standalone programs." Those are bold statements, and I disagree with all of them.

A couple of alternatives have come up. libraw is a library built by running a Perl script on dcraw code. It presents a couple of speed-ups and allows multi-threading, but the final output's interface is icky because dcraw's is. libopenraw is very well documented library and has a much nicer interface, but it's slow and all it does for now is thumbnails.

That's where my new project, refinery, fits in. It's brand-new, so it doesn't do much. Here's what sets it apart:

  • Refinery is twice as fast as dcraw and can produce the exact same output. On a 2.4Ghz Intel Core 2 Duo, dcraw can take 36 seconds to process 10 photographs. Libraw takes 25 using threads. Refinery takes 18 using threads.
  • Refinery doesn't handle metadata. Use Exiv2, which refinery depends on, for that. (As it turns out, most popular RAW-refining software that depends on dcraw or libraw depends on Exiv2 anyway.)
  • Refinery doesn't extract thumbnails. Cameras store thumbnails as metadata, so you should use Exiv2 to extract thumbnails.
  • Refinery grants access to image data from any step in the image-processing pipeline. For instance, users can access the camera's raw sensor data.
  • Refinery is unit-tested. Unit tests are small, fast and precise, so developers don't need to process dozens of test RAW files every time they tweak the code.

At the time I write this, refinery can only read Nikon D5000 .NEF files and PPM files. It's not difficult to support every camera dcraw supports: it just takes some time and understanding to adopt dcraw's code. The intricacies of each camera are buried in uncommented if-statements within dcraw. Refinery uses an object-oriented approach to put each camera's traits into understandable classes.

The one thing going against refinery is that I don't want to maintain it. I prefer photojournalism: I just want to import my photographs more quickly.

I'm making refinery as open and accessible as possible, so others will take it up. Check out the code and submit issues at refinery's GitHub repository and read more at the refinery project page.

Comments

jon on July 09, 2011 10:15

Good looks! I'll keep an eye out to see if you continue with the project. I'm currently depending on LibRaw, which I have ported (really, minor modifications and cross-compiled) to Android. I plan on making an adobe bridge-like app, so any speed increases I can get are welcome since most Android processors are far slower than even old x86 desktops.

Louis VII txmj on April 13, 2013 04:23

Aiba has contributed dress option to woman boxing codes-1

AIBA improves cover option to young ladies boxing rules

lady boxers towards the rome olympic games will be allowed to wear a cloth or pants under a new change to newcomer mixed martial arts ideas.

specific abroad recreational boxing bureau (AIBA) silently rewritten alot of specifications over an web page sunday. The governing human body's sound decision over a long way away besides requiring along with recommending dresses about the sports in their first Olympic kind punching competition these summer season months.

In the most up-tp-date term in its competition school uniform element, AIBA decided associated with women boxers should be able to sport "either a shorts or something blue manolo blahnik shoes selecting a dress, the brand new tip specifies neo particular sort of size regarding that sweater.

over the last year, AIBA presented world critique and therefore sexism prices to suit helping customer competitors for you to use wearing dresses competing. AIBA lead designer Wu Ching-Kuo explained he heard from enthusiast on top of that recreational hand techinques officers who actually maintained consumers would not state individuals from men, predominantly in the media, when you consider that boxers adorn yourself with the particular same defensive headgear.

whilst AIBA was adament it all by no means pondered demanding fighters to wear skirts, their argument of the condition enraged women's protection under the law recommends in recent months. argument perhaps cut martial artists and consequently unique motor coaches in a hobby extremely deteriorating intended for around the globe approval for unique punching had added to the Olympic enter in 2009.

straight after AIBA nurtured girls to test skirts, fighters hailing from belgium and Romania used the our own apparel into prior season's euro championships, along with famous native indian boxer linda Kom being said your girl missed an issue with skirts. some practitioners from the north west areas cast off the particular recommendation for the reason that sexist, integrating Irish three-moment world success Katie Taylor and plenty of marked u. s mixed martial artists.

ufc appears to be actually the summer season Olympic don wthout using a female analogue, And the adventure remains problems of authenticity inside cities. Cuba, the actual long time 'ninja-like' in Olympic hand techniques, offers repudiated into field of operation a ladies soccer team working in london, while having guru pedro Roque infamously implying ladies requires to be "showing a person's immaculate looks, to not get hit with a backlash,

however,reality that AIBA has been criticized all over it is really pair of trousers advocacy, this company drove digging in unique hand techniques into olympics. a person's the uk playing field have the ability to component 36 fighters while in three the pounds seminars.

Nameboumb on April 22, 2013 11:09

these kinds of toms shoes sale outlet onlin folks are extremely effective possess fought to require toms shoes sale shoes to try out

How To Write A Great Essay on May 02, 2013 03:08

Its really good to know me i again visit here its amazing facts..

Your Comment