Skip to content

Instantly share code, notes, and snippets.

View dbast's full-sized avatar

Daniel Bast dbast

  • Bavaria, Germany
View GitHub Profile
@dbast
dbast / uniform_exposure.py
Created December 11, 2013 21:13
uniform_exposure.py multiprocessing version
# Develop a bunch of raw pics so they look pretty much equally exposed.
# Copyright (2013) a1ex. License: GPL.
# Requires python, ufraw, enfuse, ImageMagick and exiftool.
# Usage:
# 1) Place your raw photos under a "raw" subdirectory; for example:
#
# $ ls -R
# .:
@dbast
dbast / uniform_exposure.patch
Created December 11, 2013 21:12
uniform_exposure.py multiprocessing patch
--- uniform_exposure.py 2013-12-11 21:23:03.000000000 +0100
+++ uniform_exposure_par.py 2013-12-11 22:04:49.000000000 +0100
@@ -66,18 +66,16 @@
# =====================================================================================
import os, sys, re, time, datetime, subprocess, shlex, shutil
+from multiprocessing import Pool
from math import *
+
+os.putenv("OMP_NUM_THREADS", "1") # optimizes the parallelisation, by allowing only one OpenMP thread per shell programm
@dbast
dbast / uniform_exposure.py
Last active August 30, 2022 23:47
uniform_exposure.py with exiftool sRGB and tiff patch (--out-depth=16) applied
# Develop a bunch of raw pics so they look pretty much equally exposed.
# Copyright (2013) a1ex. License: GPL.
# Requires python, ufraw, enfuse, ImageMagick and exiftool.
# Usage:
# 1) Place your raw photos under a "raw" subdirectory; for example:
#
# $ ls -R
# .:
@dbast
dbast / uniform_exposure.patch2
Last active December 30, 2015 02:09
uniform_exposure.py tiff patch (--out-depth=16)
--- uniform_exposure.py 2013-12-02 22:12:21.000000000 +0100
+++ uniform_exposure_patched2.py 2013-12-02 23:27:51.000000000 +0100
@@ -44,6 +44,9 @@
# for the final output (set to None for disabling, try around 128 for flicker-free video/timelapse)
target_median = None
+# jpeg-quality of the final image, between 0 and 100
+jqual = 98
+
raw_dir = 'raw'
@dbast
dbast / uniform_exposure.patch1
Created December 2, 2013 22:38
uniform_exposure.py exiftool sRGB patch
--- uniform_exposure.py 2013-12-02 22:12:21.000000000 +0100
+++ uniform_exposure_patched1.py 2013-12-02 23:05:20.000000000 +0100
@@ -393,12 +393,12 @@
run(cmd)
if 1:
- # copy over exif-data (without old preview/thumbnail-images and without orientation as ufraw already takes care of it) and add comment with processing parameters
+ # copy over exif-data (without old preview/thumbnail-images and without orientation/icc-profile as ufraw already takes care of it), setting colorspace to sRGB and add comment with processing parameters
comment = "overall_bias=%g; highlight_level=%g; midtone_level=%g; shadow_level=%g; ufraw_options='%s'; " % (overall_bias, highlight_level, midtone_level, shadow_level, ufraw_options)
comment += "midtones: brightness level %5d => exposure %+.2f EV; " % (mm, ecm)
# Develop a bunch of raw pics so they look pretty much equally exposed.
# Copyright (2013) a1ex. License: GPL.
# Requires python, numpy, dcraw, ufraw, enfuse and ImageMagick.
# Usage:
# 1) Place your raw photos under a "raw" subdirectory; for example:
#
# $ ls -R
# .:
--- uniform_exposure.py 2013-10-15 11:15:45.000000000 +0200
+++ uniform_exposure_patched.py 2013-10-15 12:23:11.000000000 +0200
@@ -52,7 +52,7 @@
import os, sys, re, time, datetime, subprocess, shlex
from math import *
-from pylab import *
+from numpy import *
direrr = False