Wie am schnellsten JPGs aus RAW am Mac autom. Konvertieren?

Die Rubrik rund um das Thema Bildbearbeitung und Software. Techniken, EBV-Software, Tipps,...

Moderator: pilfi

alexis_sorbas
Sollte mal wieder fotografieren...
Beiträge: 5272
Registriert: Fr Jun 10, 2005 13:37

Beitrag von alexis_sorbas »

War gar nicht so schwierig:

Erstmal als "Schnelle Lösung":

(*

NEF in JPEG wandeln... Version 0.1

Das Script ist Freeware und jeder Benutzer kann es seinen Bedürfnissen anpassen, und /oder
weitergeben.
Haftung für irgendwelche Schäden, die aus der Benutzung des Scripts entstehen könnten,
übernehme ich selbstverständlich nicht.

Bekannte Einschränkungen und Fehler:
Das Script funktioniert nicht, wenn sich der Quell/Zielordner auf einem mit
"FileVault" verschlüsselten Volume befindet.
Eine Fehlerüberwachung in irgendeiner Form fehlt auch.

Das Script sollte ab Macos X 10.4.6 funktionieren, getestet habe ich aber nur
mit 10.4.8. Die verwendeten "Image-Events" zur Umwandlung
sollten jeweils die neuesten sein, deshalb wird
z.B. die D80 noch nicht unterstützt.

*)



display dialog "Quellordner auswählen" buttons {"Abbruch", "Ordner auswählen"} default button 2

if the button returned of the result is "Ordner auswählen" then
   set folderSelected to choose folder with prompt "RAW(NEF)-Verzeichnis auswählen"
   copy (folderSelected as string) to myPath
end if

set RAWPath to myPath as alias
set JPEGPath to myPath

tell application "Finder"
   set these_files to files of RAWPath
   repeat with i from 1 to number of items in these_files
      set this_file to item i of these_files
      set this_info to info for (this_file as alias)
      if visible of this_info is true and alias of this_info is false then
         if ((name extension of this_info is "NEF") or (kind of this_info is in {"Nikon Image File Format"})) then
            tell application "Image Events"
               launch -- always use with Folder Actions
               set this_image to open file (this_file as string)
               save this_image as JPEG in file JPEGPath with icon
               close this_image
            end tell
            
         end if
      end if
   end repeat
end tell


... zum lesen...

mfg

Alexis

Anhang:

Rauskopieren und im "Scripteditor" einfügen und sichern...
---------------schnipp------------------------------------------
(*

NEF in JPEG wandeln... Version 0.1

Das Script ist Freeware und jeder Benutzer kann es seinen Bedürfnissen anpassen, und /oder
weitergeben.
Haftung für irgendwelche Schäden, die aus der Benutzung des Scripts entstehen könnten,
übernehme ich selbstverständlich nicht.

Bekannte Einschränkungen und Fehler:
Das Script funktioniert nicht, wenn sich der Quell/Zielordner auf einem mit
"FileVault" verschlüsselten Volume befindet.
Eine Fehlerüberwachung in irgendeiner Form fehlt auch.

Das Script sollte ab Macos X 10.4.6 funktionieren, getestet habe ich aber nur
mit 10.4.8. Die verwendeten "Image-Events" zur Umwandlung
sollten jeweils die neuesten sein, deshalb wird
z.B. die D80 noch nicht unterstützt.

*)



display dialog "Quellordner auswählen" buttons {"Abbruch", "Ordner auswählen"} default button 2

if the button returned of the result is "Ordner auswählen" then
set folderSelected to choose folder with prompt "RAW(NEF)-Verzeichnis auswählen"
copy (folderSelected as string) to myPath
end if

set RAWPath to myPath as alias
set JPEGPath to myPath

tell application "Finder"
set these_files to files of RAWPath
repeat with i from 1 to number of items in these_files
set this_file to item i of these_files
set this_info to info for (this_file as alias)
if visible of this_info is true and alias of this_info is false then
if ((name extension of this_info is "NEF") or (kind of this_info is in {"Nikon Image File Format"})) then
tell application "Image Events"
launch -- always use with Folder Actions
set this_image to open file (this_file as string)
save this_image as JPEG in file JPEGPath with icon
close this_image
end tell

end if
end if
end repeat
end tell
---------------------------schnapp---------------------------------------------------
mfg

Alexis


Amateure sorgen sich um ihr Equipment
Profis sorgen sich um das Geld
Meister sorgen sich um das Licht

jockel

Beitrag von jockel »

Hola,

das Script funktioniert prima! Vielen Dank dafür! Wenn wir uns mal treffen, gebe ich Dir einen aus. :)
Einziger Verbeserungsvorschlag: Fortschrittanzeige und/oder Finished-Button und es wäre perfekt.

Aber auf jeden Fall hast Du mir damit eine Freude gemacht. :super: :bgrin:

alexis_sorbas
Sollte mal wieder fotografieren...
Beiträge: 5272
Registriert: Fr Jun 10, 2005 13:37

Beitrag von alexis_sorbas »

jockel hat geschrieben:...das Script funktioniert prima! Vielen Dank dafür! Wenn wir uns mal treffen, gebe ich Dir einen aus. :)
Einziger Verbeserungsvorschlag: Fortschrittanzeige und/oder Finished-Button und es wäre perfekt...
Öhhm... was erwartest Du von einer 0.1er Version... :bgrin:

Wie lange braucht das Script denn, sagen wir mal für 100 D2X-Nefs?

mfg

Alexis

Auf meinen G4 PB 667 rödelt er seit ca. 22 Min im Hintergrund... ca 25 fehlen noch... OK, gut 40 Minuten für 100 D2X-NEFs... ist das jetzt schnell? ... macht ca. 24 Sek. je Bild...
Zuletzt geändert von alexis_sorbas am Mi Okt 18, 2006 20:28, insgesamt 2-mal geändert.
mfg

Alexis


Amateure sorgen sich um ihr Equipment
Profis sorgen sich um das Geld
Meister sorgen sich um das Licht

jockel

Beitrag von jockel »

Na, D2X-Nefs habe ich noch nicht. ;)
Könnte zwar schneller sein, aber wenn ich das im Finder im Hintergrund abarbeiten kann ist das ok.
Die D100 Nef unkomprimiert schafft es 12 Stück in der Minute. Also 5 Sekunden pro Stück. Scheint wohl auch nicht wirklich schneller zu funktionieren... :(


Edit: Am MacBook Pro 15", 1,83 CoreDuo, 2 Gb Ram

alexis_sorbas
Sollte mal wieder fotografieren...
Beiträge: 5272
Registriert: Fr Jun 10, 2005 13:37

Beitrag von alexis_sorbas »

Ich lasse gerade mal zum Vergleich Bridge 100 NEFs konvertieren... scheint aber auch nicht schneller zu sein...
Ok, ist langsamer... für die ersten 10 hat er etwa 1 Minute je NEF gebraucht... wurde dann noch etwas schneller...letztlich ca. 45-50 Sek. je NEF.

Dann ist das Script auf meinem PB schneller als Bridge...

Wenn Du wissen willst, wann das Script mit der Konversion fertig ist, füge als letzte Zeile mal dies ein (und Lautstärke voll auf):

say "conversion finished"

Fortschrittsanzeige kommt morgen... das hier war nur ein
"Test zur prinzipiellen Machbarkeit"... :bgrin:


mfg

Alexis
Zuletzt geändert von alexis_sorbas am Do Okt 19, 2006 10:06, insgesamt 1-mal geändert.
mfg

Alexis


Amateure sorgen sich um ihr Equipment
Profis sorgen sich um das Geld
Meister sorgen sich um das Licht

alexis_sorbas
Sollte mal wieder fotografieren...
Beiträge: 5272
Registriert: Fr Jun 10, 2005 13:37

Beitrag von alexis_sorbas »

Moin, hier die Version 0.2,
jetzt mit Fortschrittsanzeige durch die Freeware "ProgBar"...

EDIT: Unter diesem Link finden sich die unterstützten Kameras.
Dazu ist aber eine Erweiterung auf die benutzten Dateierweiterungen erforderlich. So, wir hier im Script gezeigt, werden nur .NEF unterstützt.
http://docs.info.apple.com/article.html?artnum=303554

EDIT:
Das Script findet sich jetzt hier:
http://fotodesign-dirk-wenzel.de/Downlo ... PEG_02.zip
zum runterladen...

Der Quelltext:

(*

NEF in JPEG wandeln... Version 0.2

Jetzt mit Fortschrittsanzeige durch die Freeware "ProgBar"... und mit "... Fertig" Dialog.
Das Script ist Freeware und jeder Benutzer kann es seinen Bedürfnissen anpassen,
und /oder weitergeben und/oder beliebig verändern.
Haftung für irgendwelche Schäden, die aus der Benutzung des Scripts entstehen könnten,
übernehme ich selbstverständlich nicht.

Bekannte Einschränkungen und Fehler:
Das Script funktioniert nicht, wenn sich der Quell/Zielordner auf einem mit
"FileVault" verschlüsselten Volume befindet.
Eine Fehlerüberwachung in irgendeiner Form fehlt auch.
Die Fortschrittsanzeige wird nur nach jedem Umgewandelten Bild aktualisiert,
eine Aktualisierung WÄHREND der Konvertierung fehlt.

Das Script sollte ab Macos X 10.4.6 funktionieren, getestet habe ich aber nur
mit 10.4.8. Die verwendeten "Image-Events" zur Umwandlung
sollten jeweils die neuesten sein, deshalb wird
z.B. die D80 noch nicht unterstützt.

*)

(*
Variablen deklaration und Progbar Initialisierung
*)
-- Global variable ensures that the ProgBar subroutines can understand the fileList.
global fileList, mywindow

-- Launch ProgBar for the first time.
startProgBar() of me
set mywindow to "alum_prog_window2"
tell application "ProgBar"
   tell text field "field_one" of window mywindow to set contents to "NEF-->JPEG..."
   tell progress indicator "prog_one" of window mywindow to set content to ""
   tell text field "field_two" of window mywindow to set contents to ""
end tell

display dialog "Quellordner auswählen" buttons {"Abbruch", "Ordner auswählen"} default button 2

if the button returned of the result is "Ordner auswählen" then
   set folderSelected to choose folder with prompt "RAW(NEF)-Verzeichnis auswählen"
   copy (folderSelected as string) to myPath
   set RAWPath to myPath as alias
   set JPEGPath to myPath
   DoConversion(RAWPath, JPEGPath)
else
   -- Close the ProgBar window we were using.
   fadeOut(mywindow) of me
   tell application "ProgBar"
      quit
   end tell
   display dialog "Abgebrochen" buttons {"OK"} default button 1
end if

-- Die eigentliche Arbeitsroutine...

on DoConversion(RAWPath, JPEGPath)
   tell application "Finder"
      fadeIn(mywindow) of me
      tell application "ProgBar"
         activate
      end tell
      set these_files to files of RAWPath
      set fileList to name of every item of RAWPath
      set fileCount to (count of these_files)
      -- Prepare the progress bar. This 'sets up' the progress bar's state.
      prepProgress(fileCount, mywindow) of me
      repeat with i from 1 to number of items in these_files
         set this_file to item i of these_files
         set this_info to info for (this_file as alias)
         if visible of this_info is true and alias of this_info is false then
            if ((name extension of this_info is "NEF") or (kind of this_info is in {"Nikon Image File Format"})) then
               -- Increment the ProgBar window's progress bar. The 'f' variable contains a number,
               -- which is the number item currently
               -- being processed by the repeat loop.
               incrementProgBar(i, mywindow) of me
               tell application "Image Events"
                  launch -- always use with Folder Actions
                  set this_image to open file (this_file as string)
                  save this_image as JPEG in file JPEGPath with icon
                  close this_image
               end tell
            end if
         end if
      end repeat
      say "conversion finished "
      -- Conclude the progress bar. This 'resets' the progress bar's state.
      endProgress("alum_prog_window2") of me
      -- Close the ProgBar window we were using.
      fadeOut(mywindow) of me
      tell application "ProgBar"
         quit
      end tell
      display dialog "Ich bin Fertig!" buttons {"OK"} default button 1
   end tell
end DoConversion

--Notwendige Unterprogramme

-- T.J. Mahaffey | 8.19.2004
-- Updated to 0.2 on 9.9.2004
-- tj@sporksoftware.com
-- www.sporksoftware.com
-- The code contained herein is free. Re-use at will, but please include a web bookmark or weblocation file to my website if you do.
-- Or simply some kind of acknowledgement in your code.
-- Feel free to email me and tell me you've found it helpful!

--- SUBROUTINES BELOW
--- Copy from here to the end of this document.
--- Then, simply paste into the end of your own script.
--- This will give you all of ProgBar's syntax necessary for manipulation.
-- Alternatively, you could paste the code below into a script file of its own and load it as a library.

-- Prepare progress bar subroutine.
on prepProgress(someMaxCount, windowName)
   tell application "ProgBar"
      tell progress indicator "prog_one" of window windowName to set content to 0
      tell progress indicator "prog_one" of window windowName to set uses threaded animation to true
      tell progress indicator "prog_one" of window windowName to start
      tell progress indicator "prog_one" of window windowName to set minimum value to 1
      tell progress indicator "prog_one" of window windowName to set maximum value to someMaxCount
   end tell
end prepProgress

-- Increment progress bar subroutine.
on incrementProgBar(itemNumber, windowName)
   tell application "ProgBar"
      --tell text field "field_one" of window windowName to set contents to "Dateien von CF-Karte kopieren..."
      tell progress indicator "prog_one" of window windowName to set content to itemNumber
      tell text field "field_two" of window windowName to set contents to (item itemNumber of fileList)
   end tell
end incrementProgBar

-- End progress bar subroutine.
on endProgress(windowName)
   tell application "ProgBar"
      tell progress indicator "prog_one" of window windowName to stop
      tell progress indicator "prog_one" of window windowName to set content to 0
      tell text field "field_two" of window windowName to set contents to ""
   end tell
end endProgress

-- Fade in a progress bar window.
on fadeIn(windowName)
   tell application "ProgBar"
      set alpha value of window windowName to 0
      show window windowName
      repeat with i from 1 to 9
         set alpha value of window windowName to (("0," & i) as real)
      end repeat
      set alpha value of window windowName to 1.0
      set opaque of window windowName to true
   end tell
end fadeIn

-- Fade out a progress bar window.
on fadeOut(windowName)
   tell application "ProgBar"
      set fadeValue to (1 as real)
      repeat with i from 1 to 9
         set alpha value of window windowName to fadeValue
         set fadeValue to fadeValue - 0.1
      end repeat
      set alpha value of window windowName to 0.1
      set opaque of window windowName to false
      hide window windowName
   end tell
end fadeOut

-- Give a progress bar the 'barber pole' behavior.
on barberPole(windowName)
   tell application "ProgBar"
      set indeterminate of progress indicator "prog_one" of window windowName to true
   end tell
end barberPole

-- Disable the 'barber pole' behavior of a progress bar.
on killBarberPole(windowName)
   tell application "ProgBar"
      set indeterminate of progress indicator "prog_one" of window windowName to false
   end tell
end killBarberPole

on startProgBar()
   tell application "ProgBar"
      launch
   end tell
end startProgBar




Ist jetzt ein wenig länger,... Wenn Du es haben willst, ist oben am Anfang verlinkt...

mfg

Alexis
Zuletzt geändert von alexis_sorbas am Fr Jan 19, 2007 18:57, insgesamt 2-mal geändert.
mfg

Alexis


Amateure sorgen sich um ihr Equipment
Profis sorgen sich um das Geld
Meister sorgen sich um das Licht

alexis_sorbas
Sollte mal wieder fotografieren...
Beiträge: 5272
Registriert: Fr Jun 10, 2005 13:37

Beitrag von alexis_sorbas »

So, ich habe mit der "finalen" Version 0.2 nochmal einen Geschwindigkeitstest gemacht.

Testbedingungen:

PB G4 667, 1GB RAM, MaxOSX 10.4.8

Zum konvertieren von 100 D2X NEFs (komprimiert) hat er knapp 32 Minuten gebraucht, allerdings als Vordergrundapplikation, keine sonstigen laufenden Programme, von ProgBar mal abgesehen.
Macht knapp 20 sek. je Bild, das finde ich gar nicht so schlecht...

EDIT:

Wenn Du die Erzeugung der Finder-Icons weglässt, gehts noch etwas schneller... dazu in der Zeile "save this_image as JPEG in file JPEGPath with icon " einfach "with icon" weglassen...

Übrigens kann das Script mit geringfügigen Änderungen auch 16Bit Tiffs erzeugen...

mfg

Alexis
mfg

Alexis


Amateure sorgen sich um ihr Equipment
Profis sorgen sich um das Geld
Meister sorgen sich um das Licht

alexis_sorbas
Sollte mal wieder fotografieren...
Beiträge: 5272
Registriert: Fr Jun 10, 2005 13:37

Beitrag von alexis_sorbas »

Muss mich nochmal melden:

So, ich habe mit der "finalen" Version 0.2 nochmal einen Geschwindigkeitstest gemacht.

Testbedingungen:

PB G4 667, 1GB RAM, MaxOSX 10.4.8

Zum konvertieren von 100 D2X NEFs (komprimiert) hat er knapp 32 Minuten gebraucht, allerdings als Vordergrundapplikation, keine sonstigen laufenden Programme, von ProgBar mal abgesehen.
Macht knapp 20 sek. je Bild, das finde ich gar nicht so schlecht...
Bin wieder im Studio, und das konvertieren per Applescript und "Image-Events" von 100 D2x-NEFs (siehe Anmerkung) in JPEG Dateien dauert auf meinem G5 ...
2 Minuten und 3 Sekunden :super: :cool:
Ähemm :oops: da hab ich wohl den Mund zu voll genommen... das waren D70 Aufnahmen...
Für 100 D2X Nefs brauchts 4 Minuten und 24sek...


also ca. 2,5 sek je Bild... und er benutzt alle Prozessoren dafür... und er schreibt noch eine Temp-Datei je Bild und er braucht "nur" ca 80MB Speicher dafür... (für Script & Progbar & die "Image-Events")

mfg

Alexis
Zuletzt geändert von alexis_sorbas am Fr Okt 27, 2006 17:54, insgesamt 4-mal geändert.
mfg

Alexis


Amateure sorgen sich um ihr Equipment
Profis sorgen sich um das Geld
Meister sorgen sich um das Licht

Gisbert Keller
Batterie7 Kamera
Beiträge: 439
Registriert: Sa Sep 10, 2005 9:47

Beitrag von Gisbert Keller »

Nur mal so ganz außer Konkurrenz: Mit Preview Extractor hat mein alter P4, 2,6 und 2GB ein Verzeichnis mit 186 NEFs der D2x in 3:35 geschafft. Das sind 1,16 Sekunden pro NEF. :)
Die NEFs kann ich aber mit Nikon View mit ausreichendem Tempo direkt sichten.
Viele Grüße Gisbert

alexis_sorbas
Sollte mal wieder fotografieren...
Beiträge: 5272
Registriert: Fr Jun 10, 2005 13:37

Beitrag von alexis_sorbas »

Gisbert Keller hat geschrieben:Nur mal so ganz außer Konkurrenz: Mit Preview Extractor hat mein alter P4, 2,6 und 2GB ein Verzeichnis mit 186 NEFs der D2x in 3:35 geschafft. Das sind 1,16 Sekunden pro NEF. :)
Die NEFs kann ich aber mit Nikon View mit ausreichendem Tempo direkt sichten.
Viele Grüße Gisbert
Moin Gisbert,

Du hast recht, zum schnellen Sichten ist das sicher ideal.
Allerdings macht der Preview-Extractor nur das, was sein Name impliziert:
Die Eingebettete JPEG-Vorschau in eine sep. Datei auslagern. Das hat mit Raw-Konvertierung nix zu tun...
http://drchung.new21.net/previewextractor/

mfg

Alexis
mfg

Alexis


Amateure sorgen sich um ihr Equipment
Profis sorgen sich um das Geld
Meister sorgen sich um das Licht

Antworten