Re: Processing for print
Posted: 2015-02-22T07:34:21-07:00
Good stuff. The next upload of my customim page will have edits addressing the points you have raised.
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=26994
Code: Select all
set eqlDEBUG=1
%PICTBAT%eqLimit random.jpg . . . OUT1.tif [x3]
[1x]
C:\Users\***SRCDIR***>rem From image random.jpg,
C:\Users\***SRCDIR***>rem make contrast-limited histogram-equalised (with iterative redistribution) version.
convert.exe: improper image header `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/miff.c/ReadMIFFImage/1090.
convert.exe: no images defined `info:' @ error/convert.c/ConvertImageCommand/3212.
histcap=
convert: improper image header `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/miff.c/ReadMIFFImage/1090.
convert: no images defined `C:\cygwin64\tmp\OUT1_eql_gchc_cap.miff' @ error/convert.c/ConvertImageCommand/3212.
convert.exe: improper image header `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/miff.c/ReadMIFFImage/1090.
convert.exe: unable to open image `C:\cygwin64\tmp\OUT1_eql_gchc_cap.miff': No such file or directory @ error/blob.c/OpenBlob/2674.
convert.exe: no images defined `info:' @ error/convert.c/ConvertImageCommand/3212.
MeanDiffPC=
convert: improper image header `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/miff.c/ReadMIFFImage/1090.
convert: no images defined `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/convert.c/ConvertImageCommand/3212.
convert: improper image header `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/miff.c/ReadMIFFImage/1090.
convert: no images defined `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/convert.c/ConvertImageCommand/3212.
convert: improper image header `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/miff.c/ReadMIFFImage/1090.
convert: no images defined `C:\cygwin64\tmp\OUT1_eql_gchc_clhe_red.miff' @ error/convert.c/ConvertImageCommand/3212.
convert.exe: unable to open image `C:\cygwin64\tmp\OUT1_eql_gchc_clhe_red.miff': No such file or directory @ error/blob.c/OpenBlob/2674.
convert.exe: no images defined `OUT1.tif' @ error/convert.c/ConvertImageCommand/3212.
[2x]
C:\Users\***SRCDIR***>rem From image random.jpg,
C:\Users\***SRCDIR***>rem make contrast-limited histogram-equalised (with iterative redistribution) version.
histcap=13.0601815823606
convert: color separated image required `\cygwin64\tmp\OUT1_eql_gchc_cap.miff' @ error/raw.c/WriteRAWImage/528.
convert.exe: improper image header `C:\cygwin64\tmp\OUT1_eql_gchc_cap.miff' @ error/miff.c/ReadMIFFImage/510.
convert.exe: no images defined `info:' @ error/convert.c/ConvertImageCommand/3212.
MeanDiffPC=
convert: color separated image required `\cygwin64\tmp\OUT1_eql_gchc_clhe_red.miff' @ error/raw.c/WriteRAWImage/528.
convert.exe: improper image header `C:\cygwin64\tmp\OUT1_eql_gchc_clhe_red.miff' @ error/miff.c/ReadMIFFImage/510.
convert.exe: no images defined `OUT1.tif' @ error/convert.c/ConvertImageCommand/3212.
[3x]
C:\Users\***SRCDIR***>rem From image random.jpg,
C:\Users\***SRCDIR***>rem make contrast-limited histogram-equalised (with iterative redistribution) version.
histcap=13.0601815823606
MeanDiffPC=0.61274586099031
The problem may be that the script eqLimit.bat uses both %TEMP% and %CYGTEMP%. Near the start, it writes OUT1_eql_gch.miff to %CYGTEMP%, and then reads it from %TEMP%. So they must point to the same place. The difference is that %CYGTEMP% is in the Cygwin style. On my computer:afre wrote:convert: improper image header `C:\cygwin64\tmp\OUT1_eql_gch.miff' @ error/miff.c/ReadMIFFImage/1090.
Code: Select all
f:\pictures>echo %TEMP%
C:\Users\Alan\AppData\Local\Temp
f:\pictures>echo %CYGTEMP%
/cygdrive/c/Users/Alan/AppData/Local/Temp
I didn't. Small JPEGs (*_sm.jpg) are made for display only; I don't process them. Those graphs are made from eql_src1.tiff, which is 115 MB, 5120x4840 pixels, 16 bits/channel/pixel. I haven't uploaded that file, and I won't. (With my internet connection, it would take hours.)afre wrote:Wondering how you made this http://im.snibgo.com/eql_src1_cle_eql_gch.png
and this http://im.snibgo.com/eql_src1_cle_eql_gchc_clhe_red.png
out of this http://im.snibgo.com/eql_src1_sm.jpg.
From an 8-bit jpg, yes, the graph will only be 256 wide. The histogram has only 256 entries, so there is no point in being any wider. If you run eqLimit.bat on an image with more bits/channel, you will get a wider graph.afre wrote:My output is different; also 256x256.
It already spans corner-to-corner. The purpose of that section of that page http://im.snibgo.com/eqlimit.htm#tweak is to "drop" the highlights by increasing their contrast. So white stays white, but nearly white becomes darker. If you compare that graph with the previous one, you'll see a difference in slope at the right side of the graph. I combine the two here, with an arrow showing the drop:afre wrote:Correct me if I am wrong but your goal with shadows/highlights was to make the cumulated slope http://im.snibgo.com/eql_src1_clesh_eql ... he_red.png
span from one corner to the other in the graph. (If so, I wonder if there is a way to automate the task.)
Code: Select all
for /F "usebackq" %%L in (`cygpath %TEMP%`) do set CYGTEMP=%%L
I am also puzzled.afre wrote:It's still puzzling as to why I need to run the script 3x when I begin with an empty/cleared %CYGTEMP%.
Agreed. I've been working on two angles: a more intuitive setting for the user, and automatic hands-off correction. I think I've cracked both, but other stuff has distracted me.afre wrote:Right now, the lift and drop appear, at least to me, a bit arbitrary and more of a per-photo thing.
Sounds good. However, eqLimit, etc. aren't suitable for me atm becausesnibgo wrote:I think I've cracked both, but other stuff has distracted me.
It's especially annoying when processing multiple files or testing multiple parameters. Maybe it's the way the scripts handle temp files. In addition, temp files are sometimes created in-directory (e.g. eqlTile), and they aren't always cleared. You probably have good reasons for %TEMP%, %CYGTEMP% and in-directory temp files, so I won't question that. But because of the complexity, I get these problems.afre wrote:It's still puzzling as to why I need to run the script 3x when I begin with an empty/cleared %CYGTEMP%.
You could comment-out the "@call echoOffSave" at the top of the script and post the output here. Also post an input file, so I can reproduce the result.afre wrote:It's still puzzling as to why I need to run the script 3x when I begin with an empty/cleared %CYGTEMP%.
afre wrote:Please point me in the right direction; e.g. how to identify the average intensity of a SouthEast subregion. Thanks.
Code: Select all
convert in.png -gravity SouthEast -crop 100x50+0+0 +repage -colorspace Gray -format "%[fx:mean]" info:
snibgo wrote:Code: Select all
convert in.png -gravity SouthEast -crop 100x50+0+0 +repage -colorspace Gray -format "%[fx:mean]" info:
OKāthat confirms my impression of fx. What's odd is that kurtosis and skewness show different values among [...], [fx:...] and -verbose. [fx:kurtosis] and [fx:skewness], which aren't shown here, deviate more from their -verbose and non-fx counterparts. Also, [fx:depth] is nowhere near [depth]; must be a bug or metric unknown to me. Anyway, under Q32,fmw42 wrote:The range of [mean] is from 0 to quantumrange of your IM compile. The range of [fx:mean] is always from 0 to 1. Similarly for all the other statistics. The fx versions always range from 0 to 1.
Code: Select all
%imdev%identify -quiet -verbose *TIF
Image statistics:
Overall:
min: 0 (0)
max: 65535 (1)
mean: 32830.1 (0.500956)
standard deviation: 15352.3 (0.234262)
kurtosis: -1.15263
skewness: -0.117958
entropy: 0.945626
Code: Select all
%imdev%identify -quiet -format "\ndepth %[fx:depth]\nminima %[fx:minima]\nmaxima %[fx:maxima]\nmean %[fx:mean]\nsigma %[fx:standard_deviation]\nkurtosis %[kurtosis]\nskewness %[skewness]\nentropy %[entropy]\ncolors %k\n" *TIF
depth 3.72529e-09
minima 0
maxima 1
mean 0.500956
sigma 0.234263
kurtosis -1.24141
skewness -0.11368
entropy 0.945626
colors 10486993