LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-01-2008, 12:12 PM   #1
tmbigrigg
LQ Newbie
 
Registered: Nov 2007
Location: Canton, Ohio
Distribution: Ubuntu, Mepis, Damn Small Linux,
Posts: 10

Rep: Reputation: 0
RAW photo post processing


Not sure if this is where I should post this or not but here goes.
I have a Nikon d200 that I shoot in RAW (NEF) format, I am looking for a program and/or script that will automatically convert the RAW files into .jpg files and save three copies of the file. One color, one sepia, one black and white and then append the file names DSC_1000.NEF to match the colors. ie. DSC_1000_color.jpg, DSC_1000_sepia.jpg, DSC_1000_bw.jpg.

Any advise, help, pointers would be very much appreciated.

tmbigrigg@gmail.com
 
Old 06-01-2008, 12:40 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
dcraw will help you doing the raw to jpeg part.
Processing can be done with imagemagick.
 
Old 06-03-2008, 04:40 PM   #3
tmbigrigg
LQ Newbie
 
Registered: Nov 2007
Location: Canton, Ohio
Distribution: Ubuntu, Mepis, Damn Small Linux,
Posts: 10

Original Poster
Rep: Reputation: 0
OK so I can use dcraw to convert the NEF (RAW) files to .JPG. and I can use the following command to convert to Sepia-Tone and black and white:
convert filename.JPG -sepia-tone 75% filename.sepia-tone.JPG
convert filename.JPG -colorspace Gray filename.bw.JPG

How can I use these commands in a script that will act on multiple filenames within a directory and/or directory tree. The following is an example of the directory structure that I want to work with. I would also ideally like to save the Sepia and Black and White JPGs in their own folders within the parent directory. The final result would be something where 2008-05-07, 2008-05-09 and 2008-05-15 would end up with additional directories for Sepia and BW created and the sepia and BW files moved into those directories.


2008-05-07
DSC_1000.JPG
DSC_1001.JPG
DSC_1002.JPG
DSC_1003.JPG
2008-05-09
DSC_1004.JPG
DSC_1005.JPG
DSC_1006.JPG
2008-05-15
DSC_1007.JPG
DSC_1009.JPG
DSC_1025.JPG
 
Old 06-03-2008, 07:09 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
That might be something like:
Code:
for dir in ????-??-??
do
  echo "Processing $dir"
  (
    cd $dir || exit
    mkdir sepia-tone bw || exit
    set -- $(ls DSC*.JPG 2>/dev/null) >/dev/null
    for file
    do
      bn=$(basename $file .JPG)
      dcraw -c $file | cjpeg > $bn.jpg
      convert $bn.jpg -sepia-tone 75% sepia-tone/$bn.sepia-tone.jpg
      convert $bn.jpg -colorspace Gray bw/$bn.bw.jpg
    done
  )
done
 
Old 06-04-2008, 08:30 AM   #5
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 509

Rep: Reputation: 41
Or use PerlMagick; Image Magick has a Perl interface. (And several other languages...)
 
  


Reply

Tags
photography, raw


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: UFRaw 0.12 could make new converts to open source RAW photo conversion LXer Syndicated Linux News 0 08-29-2007 01:10 PM
LXer: Rawstudio: A fast and light RAW photo converter LXer Syndicated Linux News 0 04-24-2007 09:16 PM
gimp won't open raw photo due to dcraw 5matyb5 Linux - General 3 04-18-2007 09:44 AM
LXer: Review: Raw Therapee 1.1 promises robust photo conversion LXer Syndicated Linux News 0 11-25-2006 05:21 AM
LXer: Processing RAW image files on Linux LXer Syndicated Linux News 0 08-08-2006 07:54 PM


All times are GMT -5. The time now is 03:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration