Batch conversion Nikon NEF <---> JPG (command line) programs?

Discussion in 'Digital Photography' started by Erhard Ducke, Nov 16, 2004.

  1. Erhard Ducke

    Erhard Ducke Guest

    Hi rpd!

    I'm searching for a tool to batch convert from NEF to JPG format if
    possible from command line.
    Are there any programs that do this job?

    Thanks for any help!
    Erhard Ducke, Nov 16, 2004
    1. Advertisements

  2. Erhard Ducke

    Owamanga Guest

    If you have Photoshop CS, you can achieve the same thing with File /
    Automate / Web Photo Gallery. Set it not to resize the jpgs, and in
    the output directory, you'll find a JPG for each NEF.

    You could probably achieve the same thing with more control by using
    actions and File/Automate/Batch. For example, add an
    auto-colors/auto-levels stage.

    Given the proprietary nature of the format, I doubt you'll find
    command line utils to do this. But I'd be interested too.

    ... however, either way, you miss out 'tweaking' exposure / levels for
    each NEF. (Unless, you have already imported them before, in which
    case the NEF (or something) remembers your preferences from last time,
    for each image - so it won't matter).
    Owamanga, Nov 16, 2004
    1. Advertisements

  3. Erhard Ducke

    Erhard Ducke Guest

    DCRAW from

    can do this job for Canon RAW files.
    It recognizes NEFs too but gives an error message that it can't
    process them yet.
    DCRAW also does several modifications as you can see on the

    Raw Photo Decoder v5.02 with Lossless JPEG support
    by Dave Coffin at cybercom dot net user dcoffin

    Usage: c:/windows/dcraw.exe [options] file1 file2 ...

    Valid options:
    -i Identify files but don't decode them
    -c Write to standard output
    -o file Write output to this file
    -f Interpolate RGBG as four colors
    -d Document Mode (no color, no interpolation)
    -q Quick, low-quality color interpolation
    -g <num> Set gamma (0.8 by default, only for 24-bit output)
    -b <num> Set brightness (1.0 by default)
    -w Use camera white balance settings if possible
    -r <num> Set red multiplier (daylight = 1.0)
    -l <num> Set blue multiplier (daylight = 1.0)
    -2 Write 24-bit PPM (default)
    -3 Write 48-bit PSD (Adobe Photoshop)
    -4 Write 48-bit PPM

    Perhaps it will do the same with NEFs in a future version...
    Erhard Ducke, Nov 16, 2004
  4. Erhard Ducke

    Owamanga Guest

    Hmm, maybe it depends on the model, the page:

    ...lists the following Nikons as working:

    Nikon D1
    Nikon D1H
    Nikon D1X
    Nikon D100
    Nikon D2H
    Nikon D70
    Nikon E950 ("DIAG RAW" hack)
    Nikon E990 ("DIAG RAW" hack)
    Nikon E995 ("DIAG RAW" hack)
    Nikon E2100 ("DIAG RAW" hack)
    Nikon E2500 ("DIAG RAW" hack)
    Nikon E4300 ("DIAG RAW" hack)
    Nikon E4500 ("DIAG RAW" hack)
    Nikon E5000
    Nikon E5400
    Nikon E5700
    Nikon E8700
    Nikon E8800

    Tested it on a D70 NEF and the result was horrible. (About 5 stops too
    dark) but it did read the file.
    Owamanga, Nov 16, 2004
  5. Erhard Ducke

    Owamanga Guest

    ...okay, I got DCRAW working with a D70 NEF so long as you remember the
    following options:

    -w (Camera white-balance)
    -2 (The default, PPM file)

    I first tried option -3 for a PSD file which gave me an almost black
    image, as does option -4 for a 24 bit PPM file.

    Got the brightness thing to work, but not the gamma. So, it's a little
    funky still.
    Owamanga, Nov 16, 2004
  6. Erhard Ducke

    Jürgen Eidt Guest

    The current version is v6.11, see my compilation for Windows:
    Jürgen Eidt, Nov 16, 2004
  7. Erhard Ducke

    Gadgets Guest

    Photoshop CS? Javascripting...

    Cheers, Jason (remove ... to reply)
    Video & Gaming:
    Gadgets, Nov 18, 2004
  8. Erhard Ducke

    gsum Guest

    Batch processing NEFs to JPGs seems to negate the reasons for
    using NEF in the first place. Or am I missing summat?

    gsum, Nov 18, 2004
  9. In additon to the freeware dcraw that somebofy else has already
    pointed out:
    - Bibble (
    - C1 (

    Both is available on a 30 day try-before-you-buy basis.

    A friend using with a D70 looking for NEF batch processing just
    tested all three and ended up with Bibble.
    Gisle Hannemyr, Nov 18, 2004
  10. Erhard Ducke

    Owamanga Guest

    Here's one reason:

    The storage pundits would have to believe that in 50 years (or less)
    the proprietary RAW formats such as NEF will no longer be readable by
    software in use at that time. (I completely disagree with this claim)

    So, they recommend you convert the NEFs to a standard format, such as
    JPEG to future-proof your images, but that does not imply that you
    should destroy the original NEF.

    This approach also means you don't need to use Nikon's NEF+JPEG option
    that wastes space on the CF card when you could just be shooting NEF,
    and make the JPEGS later.

    I do use NEF+JPEG at shoot-time, because it gives me a much faster
    method of previewing once they are on my PC, but I never use those
    JPEGs for anything else.

    I see no point in a fully automated conversion that prevents you from
    doing individual import-time tweaking from the NEF. If a job's worth
    doing, it's worth doing properly.
    Owamanga, Nov 18, 2004
  11. Think so.

    Camera RAW (NEF, CRW, etc) gives you data with extra dynamic latitude,
    the option to adjust WB, etc. - but you already know that.

    But if you shoot a lot (and with digital, you tend too shoot a lot),
    you haven't got the time to process every RAW shoot "by hand".
    To convert a lot of camera RAW images "by hand" quickly becomes a
    royal pain.

    That means that you either go back to JPEG for the majority of your
    shots, or you use a batch converter that just pulls the camera presets
    out of the RAW data and use those to create JPEGs (i.e. you get more
    or less the same JPEG that the camera would have given you if you had
    it set to shoot JPEG - so just using batch doesn't help).

    But: The advantage is that for those few, great shoots that are worth
    it, if you have the RAW you can /go back/ and redo the conversion "by
    hand". As there are many situations when you won't know before you
    shoot whether this is a "RAW moment" (my apologies to Kodak), this
    gives you the best of both worlds.
    Gisle Hannemyr, Nov 18, 2004
  12. Erhard Ducke

    Owamanga Guest

    I've seen this argument before, but it makes no sense. How many
    'keepers' are you getting in a day that you cant spend 30 seconds
    adjusting levels / color balance / de-vignetting / re-cropping etc
    from a RAW to finish them off?

    ...and for those shots that aren't keepers, why bother converting them
    at all?

    ...does this imply that people who can't spend time on RAW also have a
    point-n-shoot attitude? Never consider shutter speed / aperture /
    composition before pressing the button?

    ... I mean, have they ever heard of a dark-room? Lots of people
    routinely spend hours on an image *after* it was taken. It's this
    stage that completes the photography experience, so in my opinion,
    it's fairly critical.
    No. Leaving the camera in RAW+JPEG gives you the best of both worlds.
    The unattended batch conversion doesn't buy much at all. You save the
    space of the JPEG on the CF card, but that's not worth the hassle it
    Owamanga, Nov 18, 2004
  13. Erhard Ducke

    John Guest


    - John
    John, Nov 18, 2004
  14. Erhard Ducke

    John Guest

    I agree it's critical for the 20% or so of photos I take that are really
    great (or just need more work). As an amateur, however, I also tend to take
    a lot of snapshot-type photos which, though valuable to me and fun to help
    remember an event, certainly are no masterpieces. I mean, surely you
    wouldn't spend "hours" on each image (out of perhaps 100 - or more!) taken
    at a child's birthday party, but I'm certainly not going to just discard
    them, either. Taking my photos in RAW and batch-processing later gives me,
    as Gisle says, the best of both worlds.

    - John
    John, Nov 18, 2004
  15. IIRC, the only Nikon that offer this is an option is the D70 - and it
    is petty limited. For instance, only "Basic" (i.e. pretty grim)
    JPEG quality is available in this mode.
    There is no hassle when you've set up your workflow for batch.
    The extra CF card space is welcome, as is more control over the
    Gisle Hannemyr, Nov 18, 2004
  16. Erhard Ducke

    bob Guest

    For the snapshots, how much advantage does RAW give? Why not just shoot
    them in .jpg to begin with? With my camera (CP 5000), there doesn't seem to
    be any point to RAW unless I'm going to spend time on the image.

    bob, Nov 18, 2004
  17. Erhard Ducke

    Owamanga Guest

    Well, I still use RAW for such events and tweak any images that are
    destined for the printer. Not hours, but 20-60 secs a piece. I use the
    D70 in RAW+JPEG so the jpegs are used just to preview the set
    on-screen before deciding which ones will be read as RAW and prepped
    for the print.

    I probably print less than 10%, especially if my baby daughter is
    involved and I've been shooting at 3fps. Since going digital I nearly
    always do exposure bracketing and flash EV bracketing.

    Raw prepping involves:

    Import NEF, exposure & color balance correction, de-vignette and
    occasionally de-noise for high ISO shots - 20secs.

    About 1 in 200 need anti-redeye processing, where I've taken
    long-distance 300mm direct-flash photos. This can take some time.

    Sometimes add new layer, create layer mask, graduated fill on mask,
    back to the non-mask and add warm-up on masked layer. 15 secs.
    (Graduated warm for some pictures with sky in them, or to make my
    silver car look like it's been in a CSI-Miami episode.) The only
    filter I'll use on-camera is a polarizer.

    Then bung it through a Photoshop action that does a resize to native
    output res, boost saturation by 10% (the D70 is 'bland') and performs
    unsharp mask based on destined output size, finally saving it as a
    JPEG. 5 secs.

    Jump back using history to the filter/touch up stage and repeat a
    second action that creates a 800x600 sharpened suitable for email, if
    I so wish.

    If I've spent less than 30 seconds adding grad filters, red-eye,
    removing objects (such as far away birds in the sky) or other
    touch-ups then I don't even bother keeping the PSD file.
    Owamanga, Nov 18, 2004
  18. Erhard Ducke

    Owamanga Guest

    Works fine for a preview, and to make the first call on if this might
    be a 'keeper' or not. I don't ever do anything else with them.
    Well, I guess you use the jpegs for something else.
    Owamanga, Nov 18, 2004
  19. Erhard Ducke

    John Guest

    I agree, IF I KNEW IN ADVANCE which photos would be "something special" vs.
    just a snapshot. Very often, I take what I was expecting to be a snapshot
    and catch something magical: a perfect expression, an interesting tableaux,
    an evocative swath of light, etc. For those occasions, I'm thrilled to have
    the RAW "source" to get the most out of it. To me, it's MUCH more invasive
    to switch back and forth from JPEG to RAW than to just shoot everything RAW
    and include the conversion in my workflow. Again, FOR ME, the RAW-based
    workflow (for all my photos) just makes more sense.

    - John
    John, Nov 18, 2004
  20. Erhard Ducke

    Roger Guest

    If you use either photoshop CS or Elements they are quite capable
    although you may need to download the plugin for Elements.

    Actually, Elements is easier to set up the CS.
    Even with CS, it's like creating a Macro. Create a function name,
    You turn on the record function, go through the steps of converting
    one NEF to a JPG including any resizing and quality. Turn off the
    record function. Now you can select it to do as many as you wish.

    Roger Halstead (K8RI & ARRL life member)
    (N833R, S# CD-2 Worlds oldest Debonair)
    Roger, Nov 19, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.