DiyPhotoBits.com

A few bits and pieces about photography

DiyPhotoBits.com header image 2

for /f “tokens=*” %x in (‘dir /b *.nef’) do dcraw -e %x

February 20th, 2009 · 7 Comments

Sorry, being a total geek here.

If you are also a command line geek you will look at the above and go Ahhhh…

Otherwise, it means nothing and you can skip over this post.  :-)

For the rest of you — the above “converts” NEF files into JPG faster than anything you have ever seen before.

And is great for converting 250 NEF files you snapped of something totally unimportant that should have been shot in jpg and not raw.

For example: we visited a couple of flats/apartments this weekend (thinking about moving) and I put a Sigma 10-20mm Best of the Best 4: Without Warning hd on my D300 and walked around shooting absolutely everything.  The idea was that once we got home if we thought “hey, was there an xyz in the whatever room of that second one” or something like that we could jsut refer to the images rather than go back or phone and ask.  So to cover everything, even at super wide, I was shooting like crazy.  Barely aiming, not bothering to focus (and that lens managed fine actually, very well for this purpose).

But I got home and found I had 250+ raw files — or almost 4G of data!  Drat, should have switched to jpg for these snapshots, but now what do I do?  Sure I can batch them through ACR or photoshop, but it’ll take forever.

So luckily I had just been looking at dcraw, the command line raw processor recently, I had the Windows build, and tada.

for /f "tokens=*" %x in ('dir /b *.nef') do dcraw -e %x

An command line that takes all the raw files in the directory and spits out jpg files instead.  After that I just del *.nef and I’m done.

Up side:

  • Fast
  • No settings to worry about
  • Fast
  • Did I mention fast?  We are talking less than a second an image.

Downside:

  • It isn’t really converting the raw fileof course, it is merely extracting the basic Jpeg that is embedded in the raw file.  But that’s “good enough” for what I wanted.

Still a good trick and to save me having to think about the syntax next time I have to do this I’m blogging about it so I can go back and refer to my own blog.  I knew there was a reason I was blogging!

And of course now that I know dcraw can do this I’ll be looking to integrate raw preview into Camera Control using this.  In my copious free time!  Huh!

PS.  There should have been a video today about how to do the paper grid spot, but I totally messed up the recordings and all the files are a disaster so this too will have to wait for another time.

Tags: Software       

7 responses so far ↓

  • 1 Peter S // Feb 22, 2009 at 3:51 pm

    You can do the same with exiftools. There are a both a thumbnail jpeg and a preview jpeg inside all Nikon NEFs. It might even be faster, I don’t know :-)

  • 2 James // Feb 27, 2009 at 5:06 pm

    say i wanted to convert all nefs in my documents how would i do it

  • 3 Nathan deGargoyle // Apr 28, 2009 at 7:31 pm

    Firstly I’ve just downloaded camera control and I am going to have so much fun with this (although you need a more obvious “how to” link for those of us who know more about cameras than we do about computers. It comes across as pretty scary!)

    Secondly Irfanview has a great batch convert option which works well for .nefss

  • 4 Nathan deGargoyle // Apr 28, 2009 at 7:32 pm

    irstly I’ve just downloaded camera control and I am going to have so much fun with this (although you need a more obvious “how to” link for those of us who know more about cameras than we do about computers. It comes across as pretty scary!)

    Secondly Irfanview has a great batch convert option which works well for .nefs

  • 5 up here // Nov 2, 2013 at 5:24 am

    Only using our Custom Application Development Services you will obtain maximal result. Visit SoftGroup and skilled professionals will satisfy all your needs and businesslike purposes.

  • 6 writing services uk // Dec 27, 2013 at 5:04 am

    Are you super bored with your writing assignments? Then visit this website and buy custom essays uk right now!

  • 7 formatting service // Dec 28, 2013 at 3:09 pm

    The crisis caused a lot of harms to students’ budgets. Nonetheless, writing a term paper “supreme-essay.com” company will propose the best costs for academic research papers. So, your spending will be small.

Leave a Comment