snibgo's ImageMagick pages

Dcraw, gamma and eqLimit

What are the best dcraw gamma and auto-brighten settings for various purposes?

dcraw reads a raw camera file and creates a tiff output. It has a variety of settings. This page considers two: "-g" for gamma, and "-W" which turns off auto-brighten. What are the best settings for two purposes:

  1. To quickly get a usable image?
  2. To get the best possible data for future processing?

For "future processing", the example used in this page is eqLimit.bat. This is a process that makes good first-pass images, and is also representative of manual intervention that may be desired.

Image processing is performed on full-size images. Results are heavily reduced for illustration on the web page.

An ImageMagick bug in version 6.9.1-6 causes "histogram:" images to be of MIFF format, even though they are named ".PNG". See bug report Histogram images. So I use an older version of IM for that task:

set IMH=%IMG691%

Generate results

The script gameql.bat creates a variety of results: different "-g" settings to dcraw, with or without "-W", before and after eqLimit.bat.

Note that dcraw auto-brightens by default. To turn it off, use -W.

set SRC=\pictures\20130713\AGA_1372.NEF

call %PICTBAT%gameql %SRC%

Results from dcraw

I include the results for -g 1 4.5, though it seems identical to -g 1 0. This is logical; when there is no gamma-shift, a toe-slope is meaningless.

-g setting No auto-brighten Auto-brighten
1 0 ge_AGA_1372_g1_0_nab_sm.jpg ge_AGA_1372_g1_0_nab_hist.png ge_AGA_1372_g1_0_ab_sm.jpg ge_AGA_1372_g1_0_ab_hist.png
1 4.5 ge_AGA_1372_g1_4-5_nab_sm.jpg ge_AGA_1372_g1_4-5_nab_hist.png ge_AGA_1372_g1_4-5_ab_sm.jpg ge_AGA_1372_g1_4-5_ab_hist.png
2.2222 0 ge_AGA_1372_g2-2222_0_nab_sm.jpg ge_AGA_1372_g2-2222_0_nab_hist.png ge_AGA_1372_g2-2222_0_ab_sm.jpg ge_AGA_1372_g2-2222_0_ab_hist.png
2.2222 4.5 ge_AGA_1372_g2-2222_4-5_nab_sm.jpg ge_AGA_1372_g2-2222_4-5_nab_hist.png ge_AGA_1372_g2-2222_4-5_ab_sm.jpg ge_AGA_1372_g2-2222_4-5_ab_hist.png
2.2222 12.92 ge_AGA_1372_g2-2222_12-92_nab_sm.jpg ge_AGA_1372_g2-2222_12-92_nab_hist.png ge_AGA_1372_g2-2222_12-92_ab_sm.jpg ge_AGA_1372_g2-2222_12-92_ab_hist.png
no -g setting ge_AGA_1372_gnull_nab_sm.jpg ge_AGA_1372_gnull_nab_hist.png ge_AGA_1372_gnull_ab_sm.jpg ge_AGA_1372_gnull_ab_hist.png
gamMaxSd
2.96917228 0
ge_AGA_1372_g2-96917228_0_nab_sm.jpg ge_AGA_1372_g2-96917228_0_nab_hist.png ge_AGA_1372_g2-96917228_0_ab_sm.jpg ge_AGA_1372_g2-96917228_0_ab_hist.png
4 0 ge_AGA_1372_g4_0_nab_sm.jpg ge_AGA_1372_g4_0_nab_hist.png ge_AGA_1372_g4_0_ab_sm.jpg ge_AGA_1372_g4_0_ab_hist.png

The quantitative data below shows that all the results span the full range from 0.0 to 1.0.

If the purpose is to get an image that is immediately usable, the "auto-brighten" image is superior, whatever the gamma setting. However, auto-brighten has clipped highlights in all cases, and none of the -H settings cure this.

Of the no auto-brighten results, I prefer the one with gamMaxSd.

Of the auto-brighten results, I prefer the ones with the 2.2 gamma.

Results after processing with eqLimit

The images created by dcraw are then processed with eqLimit.bat:

-g setting No auto-brighten Auto-brighten
1 0 ge_AGA_1372_g1_0_nab_eql_sm.jpg ge_AGA_1372_g1_0_nab_eql_hist.png ge_AGA_1372_g1_0_ab_eql_sm.jpg ge_AGA_1372_g1_0_ab_eql_hist.png
1 4.5 ge_AGA_1372_g1_4-5_nab_eql_sm.jpg ge_AGA_1372_g1_4-5_nab_eql_hist.png ge_AGA_1372_g1_4-5_ab_eql_sm.jpg ge_AGA_1372_g1_4-5_ab_eql_hist.png
2.2222 0 ge_AGA_1372_g2-2222_0_nab_eql_sm.jpg ge_AGA_1372_g2-2222_0_nab_eql_hist.png ge_AGA_1372_g2-2222_0_ab_eql_sm.jpg ge_AGA_1372_g2-2222_0_ab_eql_hist.png
2.2222 4.5 ge_AGA_1372_g2-2222_4-5_nab_eql_sm.jpg ge_AGA_1372_g2-2222_4-5_nab_eql_hist.png ge_AGA_1372_g2-2222_4-5_ab_eql_sm.jpg ge_AGA_1372_g2-2222_4-5_ab_eql_hist.png
2.2222 12.92 ge_AGA_1372_g2-2222_12-92_nab_eql_sm.jpg ge_AGA_1372_g2-2222_12-92_nab_eql_hist.png ge_AGA_1372_g2-2222_12-92_ab_eql_sm.jpg ge_AGA_1372_g2-2222_12-92_ab_eql_hist.png
no -g setting ge_AGA_1372_gnull_nab_eql_sm.jpg ge_AGA_1372_gnull_nab_eql_hist.png ge_AGA_1372_gnull_ab_eql_sm.jpg ge_AGA_1372_gnull_ab_eql_hist.png
gamMaxSd
2.96917228 0
ge_AGA_1372_g2-96917228_0_nab_eql_sm.jpg ge_AGA_1372_g2-96917228_0_nab_eql_hist.png ge_AGA_1372_g2-96917228_0_ab_eql_sm.jpg ge_AGA_1372_g2-96917228_0_ab_eql_hist.png
4 0 ge_AGA_1372_g4_0_nab_eql_sm.jpg ge_AGA_1372_g4_0_nab_eql_hist.png ge_AGA_1372_g4_0_ab_eql_sm.jpg ge_AGA_1372_g4_0_ab_eql_hist.png

Auto-brighten followed by eqLimit creates very high contrast and saturation.

With no auto-brighten, the results are mostly acceptable visually. When the -g gamma increases, the results become darker, and shadows clip at gamMaxSd and 4. Visually, the best result is from -g 1 0.

Quantitative data

Any processing that moves values up or down the scale, in integer arithmethic, will lose data. Some values that were different before the operation will become equal after the operation. Once they have become equal, they cannot be separated.

One measure of this is hist_entries in the following listing. It makes a histogram of 65536 buckets, incrementing the count of the buckets corresponding to the R, G and B values. The number shown is the proportion of buckets with at least one entry. The higher this number is, the better.

Examining this data, we discover that:

The data loss is not entirely cumulative. After eqLimit.bat, hist_entries varies from 0.204941 to 0.223282 (no auto-brighten) or 0.174423 to 0.176865 (with auto-brighten). Thus, when eqLimit.bat is used, auto-brighten has a large impact on data loss, but gamma has far less impact.

 ge_AGA_1372_gnull_nab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g1_0_nab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g1_4-5_nab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g2-2222_0_nab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g2-2222_4-5_nab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g2-2222_12-92_nab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g0-292401774_0_nab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g4_0_nab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_gnull_ab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g1_0_ab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g1_4-5_ab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g2-2222_0_ab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g2-2222_4-5_ab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g2-2222_12-92_ab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g0-292401774_0_ab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05



ge_AGA_1372_g4_0_ab.tiff
MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

Result of eqLimit.bat: 
MIN=1  MAX=1  MEAN=1  SD=-1.5259e-005
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05


A point of interest here: when the toe-slope is zero, the highest standard deviation comes from gamMaxSd, of course. But the setting -g 2.2222 4.5 gives a slightly higher SD. This suggests a future avenue to explore: varying the toe-slope for the maximum SD.

sRGB version from dcraw or IM?

If we want an sRGB version, we have the choice of making it with dcraw or IM. The dcraw version comes directly from dcraw, with no options for gamma or -W, so it is auto-brightened. The IM version comes from "-set colorspace RGB -colorspace sRGB", from the dcraw output of gamma 1, with auto-brighten.

The numbers from IM's sRGB image are:

 MIN=0  MAX=0  MEAN=0  SD=0
SatMin=0  SatMax=0  SatMean=0  SatSD=0
hist_entries=1.52588e-05

They are close to the numbers from dcraw's sRGB image. The IM version has a higher mean and lower SD. IM's saturation has a higher maximum, lower mean and lower SD. The number of hist_entries is identical.

The images are:

dcraw's sRGB ge_AGA_1372_gnull_ab_sm.jpg ge_AGA_1372_gnull_ab_hist.png
IM's sRGB ge_im_srgb_sm.jpg ge_im_srgb_hist.png

Confirming the numbers: IM's version has the histogram pushed right slightly, lightening the entire image, especially the shadows, and reducing most contrast.

I see no obvious preference for either version, but standardising on one is useful. I choose to use dcraw's version.

Both sRGB images above have clipped highlights, caused by dcraw's auto-brighten. An alternative is to use a non-auto-brightened source, given a contrast-limited equalisation, further tamed by "+sigmoidal-contrast" to push darkish and lightish tones towards the middle, which reduces the standard deviation and the saturation. The result isn't photometrically sRGB, but it is aesthetically pleasing, useful for further processing, and is not clipped. Here are two versions: the first from dcraw "-g 1 0", the second from unspecified "-g". They are slightly different, but I don't have a clear preference.

%IMH%convert ^
  ge_%RAW_BASE%_g1_0_nab_eql.tiff ^
  +sigmoidal-contrast 10,50%% ^
  +write ge_eql_sRGB10.tiff ^
  -define histogram:unique-colors=false ^
  +write histogram:ge_eql_sRGB10_hist.png ^
  %WEB_SIZE% ^
  ge_eql_sRGB10_sm.jpg
ge_eql_sRGB10_sm.jpg ge_eql_sRGB10_hist.png
%IMH%convert ^
  ge_%RAW_BASE%_gnull_nab_eql.tiff ^
  +sigmoidal-contrast 10,50%% ^
  +write ge_eql_sRGB.tiff ^
  -define histogram:unique-colors=false ^
  +write histogram:ge_eql_sRGB_hist.png ^
  %WEB_SIZE% ^
  ge_eql_sRGB_sm.jpg
ge_eql_sRGB_sm.jpg ge_eql_sRGB_hist.png

We may prefer an sRGB version that has a specified gamma. What gamma?

Make gamma 0.5 in RGB colorspace, which is about 0.73 in sRGB space.

%IMH%convert ^
  ge_%RAW_BASE%_g1_0_ab.tiff ^
  -auto-level ^
  -auto-gamma ^
  -set colorspace RGB -colorspace sRGB ^
  +write ge_alg_sRGB.tiff ^
  -define histogram:unique-colors=false ^
  +write histogram:ge_alg_sRGB_hist.png ^
  %WEB_SIZE% ^
  ge_alg_sRGB_sm.jpg
ge_alg_sRGB_sm.jpg ge_alg_sRGB_hist.png

Make gamma 0.5 in sRGB colorspace.

%IMH%convert ^
  ge_%RAW_BASE%_g1_0_ab.tiff ^
  -set colorspace RGB -colorspace sRGB ^
  -auto-level ^
  -auto-gamma ^
  +write ge_alg_sRGB.tiff ^
  -define histogram:unique-colors=false ^
  +write histogram:ge_sRGB_alg_hist.png ^
  %WEB_SIZE% ^
  ge_sRGB_alg_sm.jpg
ge_sRGB_alg_sm.jpg ge_sRGB_alg_hist.png

Conclusions

The questions were:

What are the best gamma and auto-brightness settings for two purposes:

  1. To quickly get a usable image?
  2. To get the best-possible data for future processing?

My answers are:

  1. Use default gamma, and auto-brighten, making a _sRGB version.
  2. Use no gamma adjustment (-g 1 0) and prevent auto-brightening (-W), making a _RAW version.

I also create an _eql version. Thus, we have three simple comands:

dcraw -v -H 0 -6 -w -o 1 -T -O out_sRGB.tiff in.nef

dcraw -v -H 0 -6 -w -W -g 1 0 -o 0 -T -O out_raw.tiff in.nef

call %PICTBAT%eqLimit out_raw.tiff . . . out_eql.tiff

The file out_raw.tiff is visually horrible (very dark), but useful for further processing. The two visual outputs are out_sRGB.tiff and out_eql.tiff. Comparing these outputs to in-camera JPEGs made by a Nikon D800, I find that:

The dcraw commands shown on this page use -w to use camera white balance, if possible, and -H 0 which uses camera white balance even if it causes clipping. I do this for convenience. In practise, I do not recommend permitting dcraw to clip images. A better solution is either to use one of the other -H XX options, or to extract the white-balance parameters and maximum pixel values, then re-calculate the parameters such that no clipping occurs. This is slow because dcraw must be called twice.

Cleanup

We don't need to keep the large TIFF files, so delete them:

del ge_*_*.tiff

Scripts

For convenience, .bat scripts are also available in a single zip file. See Zipped BAT files.

gameql.bat

rem Tests dcraw and eqLimit with a variety of parameters.
rem %1 is input raw file.

if "%IMH%"=="" set IMH=%IM%

set IN_RAW=%1
if not exist "%1" (
  echo %0: "%1" does not exist
  exit /B 1
)

set RAW_BASE=%~n1

set COUNT_PROC=-separate +append -process 'mkhisto norm' -fill White +opaque Black

set WEB_SIZE=-resize 300x300

set OUT_LIS=ge_gameql.lis
del %OUT_LIS% 2>nul

set TMP_SRGB=%TEMP%\ge_IM_srgb.tiff

set OUT_TIFF=%TEMP%\ge_temp.tiff
%IM%dcraw -v -6 -w -W -g 1 0 -o 0 -T -O %OUT_TIFF% %IN_RAW%

call %PICTBAT%gamMaxSd %OUT_TIFF% 0.05 10

call :geOne %IN_RAW% 0 . .
call :geOne %IN_RAW% 0 1 0
call :geOne %IN_RAW% 0 1 4.5
call :geOne %IN_RAW% 0 2.2222 0
call :geOne %IN_RAW% 0 2.2222 4.5
call :geOne %IN_RAW% 0 2.2222 12.92
call :geOne %IN_RAW% 0 %gmsGAM_MAX_SD% 0
call :geOne %IN_RAW% 0 4 0

call :geOne %IN_RAW% 1 . .
call :geOne %IN_RAW% 1 1 0
call :geOne %IN_RAW% 1 1 4.5
call :geOne %IN_RAW% 1 2.2222 0
call :geOne %IN_RAW% 1 2.2222 4.5
call :geOne %IN_RAW% 1 2.2222 12.92
call :geOne %IN_RAW% 1 %gmsGAM_MAX_SD% 0
call :geOne %IN_RAW% 1 4 0


rem ===============================
rem
rem Try sRGB version from IM.

%IM%convert ^
  ge_%RAW_BASE%_g1_0_ab.tiff ^
  -set colorspace RGB -colorspace sRGB ^
  %TMP_SRGB%

%IM%convert ^
  %TMP_SRGB% ^
  -format "MIN=%%[fx:minima]  MAX=%%[fx:maxima]  MEAN=%%[fx:mean]  SD=%%[fx:standard_deviation]\n" ^
  -write info: ^
  ^( +clone ^
    -colorspace HCL ^
    -format "SatMin=%%[fx:minima.g]  SatMax=%%[fx:maxima.g]  SatMean=%%[fx:mean.g]  SatSD=%%[fx:standard_deviation.g]\n" ^
    -write info: ^
    +delete ^
  ^) ^
NULL:>ge_im_srgb.lis

if ERRORLEVEL 1 exit /B 1

%IMDEV%convert ^
  %TMP_SRGB% ^
  %COUNT_PROC% ^
  -format "hist_entries=%%[fx:mean]\n" ^
  info: >>ge_im_srgb.lis

if ERRORLEVEL 1 exit /B 1

%IMH%convert ^
  %TMP_SRGB% ^
  -define histogram:unique-colors=false ^
  +write histogram:ge_im_srgb_hist.png ^
  %WEB_SIZE% ^
  ge_im_srgb_sm.jpg

if ERRORLEVEL 1 exit /B 1

exit /B 0


rem ============ Subroutines ===================
rem

rem Params to geOne:
rem  %1 raw filename
rem  %2 0 if -W (no auto-brighten); 1 if auto-brighten
rem  %3 first -g parameter (or "." for no -g)
rem  %4 second -g parameter

:geOne
set G_ARG=
set G_NAME=gnull
set G1=%3
set G2=%4
if not "%3"=="." (
  set G_ARG=-g %3 %4
  set G_NAME=g%G1:.=-%_%G2:.=-%
)
echo G_NAME=%G_NAME%
set W_ARG=
set AB_NAME=ab
if "%2"=="0" (
  set W_ARG=-W
  set AB_NAME=nab
)

set BASE=ge_%RAW_BASE%_%G_NAME%_%AB_NAME%
set OUT_TIFF=%BASE%.tiff
set OUT_EQL=%BASE%_eql.tiff
rem set OUT_LIS=%BASE%.lis
rem del %OUT_LIS% 2>nul

echo OUT_TIFF=%OUT_TIFF%

%IM%dcraw -v -H 0 -6 -w %W_ARG% %G_ARG% -o 0 -T -O %OUT_TIFF% %1
if ERRORLEVEL 1 exit /B 1

%IM%convert ^
  %OUT_TIFF% ^
  -format "%%f\nMIN=%%[fx:minima]  MAX=%%[fx:maxima]  MEAN=%%[fx:mean]  SD=%%[fx:standard_deviation]\n" ^
  -write info: ^
  ^( +clone ^
    -colorspace HCL ^
    -format "SatMin=%%[fx:minima.g]  SatMax=%%[fx:maxima.g]  SatMean=%%[fx:mean.g]  SatSD=%%[fx:standard_deviation.g]\n" ^
    -write info: ^
    +delete ^
  ^) ^
NULL:>>%OUT_LIS%

if ERRORLEVEL 1 exit /B 1

%IMDEV%convert ^
  %OUT_TIFF% ^
  %COUNT_PROC% ^
  -format "hist_entries=%%[fx:mean]\n\n" ^
  info: >>%OUT_LIS%

if ERRORLEVEL 1 exit /B 1

call %PICTBAT%eqLimit %OUT_TIFF%

if ERRORLEVEL 1 exit /B 1

echo Result of eqLimit.bat: >>%OUT_LIS%

%IM%convert ^
  %OUT_EQL% ^
  -format "MIN=%%[fx:minima]  MAX=%%[fx:maxima]  MEAN=%%[fx:mean]  SD=%%[fx:standard_deviation]\n" ^
  -write info: ^
  ^( +clone ^
    -colorspace HCL ^
    -format "SatMin=%%[fx:minima.g]  SatMax=%%[fx:maxima.g]  SatMean=%%[fx:mean.g]  SatSD=%%[fx:standard_deviation.g]\n" ^
    -write info: ^
    +delete ^
  ^) ^
NULL:>>%OUT_LIS%

%IMDEV%convert ^
  %OUT_EQL% ^
  %COUNT_PROC% ^
  -format "hist_entries=%%[fx:mean]\n\n\n\n" ^
  info: >>%OUT_LIS%

if ERRORLEVEL 1 exit /B 1

%IMH%convert ^
  %OUT_TIFF% ^
  -define histogram:unique-colors=false ^
  +write histogram:%BASE%_hist.png ^
  %WEB_SIZE% ^
  %BASE%_sm.jpg

if ERRORLEVEL 1 exit /B 1

%IMH%convert ^
  %OUT_EQL% ^
  -define histogram:unique-colors=false ^
  +write histogram:%BASE%_eql_hist.png ^
  %WEB_SIZE% ^
  %BASE%_eql_sm.jpg

if ERRORLEVEL 1 exit /B 1

rem
rem ============ End Subroutines ===================

All images on this page were created by the commands shown, using:

%IM%identify -version
Version: ImageMagick 6.9.5-3 Q16 x86 2016-07-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

Source file for this web page is gameql.h1. To re-create this web page, execute "procH1 gameql".


This page, including the images, is my copyright. Anyone is permitted to use or adapt any of the code, scripts or images for any purpose, including commercial use.

Anyone is permitted to re-publish this page, but only for non-commercial use.

Anyone is permitted to link to this page, including for commercial use.


Page version v1.0 24-Dec-2014.

Page created 16-May-2017 15:29:08.

Copyright © 2017 Alan Gibson.