Digital imaging workflow

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Mon Jun 3 20:17:05 UTC 2013


  Howsabout a thread or 2 on digital photography workflow?  Using linux
and open source software of course.  I have 4 scripts attached.  The
snoozeload() function does not need to be chmod'ed executable.  The
others do.

  I've come up with a simple multi-tasking load control on a
multi-CPU system.  My initial attempts at multi-tasking the workflow
ended up with me fork-bombing my older system (Core-Duo) into oblivion.
I did some reading of "man proc", specifically about /proc/loadavg.
Here's an example reading...

[i660][waltdnes][~] cat /proc/loadavg 
0.06 0.09 0.12 1/228 28979

  The first 3 fields are the 1/5/15 minute load averages.  They respond
way too slowly to be useful for process control.  The 4th field is
interesting.  From the man page...

> The fourth field consists of two numbers separated by a slash (/).
> The first of these is the number of currently runnable kernel
> scheduling entities (processes, threads).  The value after the slash
> is the number of kernel scheduling entities that currently exist on
> the system.

  So in the above example, there was 1 process currently active.  Note
that the Heisenberg Principle is at work.  Doing the measurement affects
the value.  The "cat" command is the 1 currently active process.
Function file "~/bin/functions/snoozeload" declares a function
"snoozeload" that accepts 1 parameter.  It's an infinite loop that
sleeps 1 second at a time, until the active process count is less than
the parameter.  snoozeload attempts to leave one core free for the
system, so it doesn't make sense for a single-core CPU system.

***IMPORTANT*** The appropriate number for the "snoozeload" parameter
appears to be the number of CPUs on your system.

  Give the huge pixelsize of the fullsize PNG, I often need a smaller
version as well.  1/3rd and 1/4th work fine.  File "binn" does "binning"
via imagemagick.  In addition to reducing size, it also reduces noise,
as if the image was shot at a lower ISO.  See the page
http://www.noao.edu/outreach/aop/glossary/binning.html for technical
details.  The script "binn" expects 3 parameters...
1 The filename of an existing image
2 The filename of the output image to be created
3 The reduction factor
binning works best with whole integer reduction.  The script jumps
through flaming hoops to ensure that the divisor goes evenly into image
size.  If necessary, "binn" will first create a copy with a small number
of pixels on the right and/or bottom edges cropped to ensure even
division.  The original image is not modified.

  The script "workflow" expects to be executed in a directory containing
CR2 and/or DNG files.  It does the following...

* sources function "snoozeload"
* creates necessary directories for fullsize, 1/3rd, and 1/4th size images
* removes a ~/.ufrawrc file if it exists

The main loop
* gets ${filename} from the "for" loop and calculates "${output_file}"
* waits in "snoozeload" until fewer than 4 processes are active (my new
  PC is a 4-core unit)
* it calls "process_raw" *AND FORKS IT OFF TO THE BACKGROUND*, and then
  proceeds to the next file in the directory

process_raw
* uses ufraw-batch to extract a full-sized PNG file from the raw file.
  The "auto" defaults for --exposure and --black-point work OK.
* once the full-sized PNG file has been created, it forks off 2 more
  processes; 1 to create a 1/3rd size copy, and another to create a 1/4
  size copy


  File "workflowj" works for JPG images.  I use it for my smartphone
camera, which is grainy even at ISO 100.  Like "workflow", it creates
destination directories.  There is no raw extraction required, so it
just loops through filenames, launching and forking processes to created
binned images.

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
I don't run "desktop environments"; I run useful applications
-------------- next part --------------
??@?Q files.tar ?X[o?6?3??"N YW?E;=m?.@/h???hY?l9??ITl??~?H],??????.?d???C??9?4????ap\:??5'c?,?U?|???i?c??
???t.?0N=1?<?^
0X{??8;?????/????0??^?@g?"?0?Y????|/????0M??9l?????????|??@????B?u???F??9??????v?@?,n$?av~???o?V?cp?Ox?k*-?P???9?? ?)I??????W?

Ba???,?-;??W-???~???\?^??6? ?PF??????nM?HN???e??z??!Z?i??????????0u}???l????o?Wo???h|??`?Y?\??	?z???'??3?0(@????[wa?B???w?Wo?f?&E?(^%???v*?n??$????~?f??>??pJA???.?)?f?G?5bZ????1^n01F??J?d?r??????? ?0????#?a?l?0?n%C?
?4?n??????bB>??x????G?
?i??r??? `N?????????&???v??k?^??@?????'GD?????D?w???????(zws.??????~??NDK?i4?)?n???U?,?8??c??7?u
"?>?????sb5??db\???X?????n?'?0?????n? xA?z?_???MB?<???SR??
??i???ZB??6-<j?G?8_f]A??<?s12?VU`nN(?zI?V?VT???6|????a????LlT????!?3?UC?=?????qwzUeXe]?Z?<??g??????8K$??~y??Q???v?????b4?55 )4??0???o-????O???????|?x&?G:??
h????w?'?????x?n?k??????r?hq?????O??@?????/?u???}i????????????wd?Z??????>???t??????-?9????????M?>?~?B? ??|??@???M??K???E??h?????q?s?u??JHHHHHHHHHHHHHHHHH???	 (  


More information about the Legacy mailing list