snibgo's ImageMagick pages

Panel of Nine

Interactive image editors allow us to tweak a slider to adjust an effect. ImageMagick is non-interactive, but here are simple scripts to quickly see the effect of adjustments without needing complex Javascript or whatever.

A sample source image, toes.png.

toes.png
set SRC=toes.png

blend9.bat

Most of these scripts need one input image. blend9.bat needs two.

%IMG7%magick %SRC% -blur 0x10 %TEMP%\src_blur.png
call %PICTBAT%blend9 %SRC% %TEMP%\src_blur.png
toes_bd9.pngjpg

colMult9.bat

call %PICTBAT%colMult9 %SRC%
toes_cm9.pngjpg

colors9.bat

call %PICTBAT%colors9 %SRC%
toes_c9.pngjpg

colShiftBY9.bat

call %PICTBAT%colShiftBY9 %SRC%
toes_by9.pngjpg

colShiftGM9.bat

call %PICTBAT%colShiftGM9 %SRC%
toes_gm9.pngjpg

colShiftRC9.bat

call %PICTBAT%colShiftRC9 %SRC%
toes_rc9.pngjpg

colTempRB9.bat

call %PICTBAT%colTempRB9 %SRC%
toes_rb9.pngjpg

colTemp9.bat

call %PICTBAT%colTemp9 %SRC%
toes_ct9.pngjpg

edge9.bat

call %PICTBAT%edge9 %SRC%
toes_ed9.pngjpg

eq9.bat

call %PICTBAT%eq9 %SRC%
toes_eq9.pngjpg

eqLabL9.bat

call %PICTBAT%eqLabL9 %SRC%
toes_eqL9.pngjpg

gamma9.bat

call %PICTBAT%gamma9 %SRC%
toes_g9.pngjpg

autoGamma9.bat

call %PICTBAT%autoGamma9 %SRC%
toes_ag9.pngjpg

lat9.bat

call %PICTBAT%lat9 %SRC%
toes_lat9.pngjpg

mode9.bat

call %PICTBAT%mode9 %SRC%
toes_md9.pngjpg

paint9.bat

call %PICTBAT%paint9 %SRC%
toes_pt9.pngjpg

posterize9.bat

call %PICTBAT%posterize9 %SRC%
toes_p9.pngjpg

sat9.bat

call %PICTBAT%sat9 %SRC%
toes_sat9.pngjpg

seg9.bat

call %PICTBAT%seg9 %SRC%
toes_seg9.pngjpg

sigmoid9.bat

call %PICTBAT%sigmoid9 %SRC%
toes_sig9.pngjpg

sigSetSd9.bat

Tries to find the sigmoidal contrasts for nine standard deviations. Each cell shows the goal SD and, if a solution is found, the sigmoidal contrast.

call %PICTBAT%sigSetSd9 %SRC%
toes_sss9.pngjpg

Scripts

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

The panel9 scripts are similar to each other. Just one is shown here. They are all available in panel9.zip.

colors9.bat

rem From image %1, makes 9-panel with varying number of colors.
rem %2 is first number. Default 1.
rem %3 is increment. Default 1.
rem %4 is 0 (no dither) or 1 (dither). Default 1.
@rem
@rem Updated:
@rem   22-August-2022 Upgraded for IM v7.
@rem

@if "%1"=="" findstr /B "rem @rem" %~f0 & exit /B 1

@setlocal enabledelayedexpansion

@call echoOffSave

call %PICTBAT%setInOut %1 c9


set BASE=%2
if "%BASE%"=="" set BASE=1

set DIFF=%3
if "%DIFF%"=="" set DIFF=1

set DITH=%2
if "%DITH%"=="" set DITH=1

if %DITH%==0 (
  set sDITH=+dither
) else (
  set sDITH=
)

@set /A f0=%BASE%
@set /A f1=%BASE%+%DIFF%
@set /A f2=%BASE%+(%DIFF%*2)
@set /A f3=%BASE%+(%DIFF%*3)
@set /A f4=%BASE%+(%DIFF%*4)
@set /A f5=%BASE%+(%DIFF%*5)
@set /A f6=%BASE%+(%DIFF%*6)
@set /A f7=%BASE%+(%DIFF%*7)
@set /A f8=%BASE%+(%DIFF%*8)

@set OPTIONS=+dither

%IMG7%magick %INFILE% -resize "300x300^>" ^
  %sDITH% ^
  ( -clone 0 ^
    ( -clone 0 %OPTIONS% -colors %f0% -gravity center label:"-colors %f0%" -append +repage ) ^
    ( -clone 0 %OPTIONS% -colors %f1% -gravity center label:"-colors %f1%" -append +repage ) ^
    ( -clone 0 %OPTIONS% -colors %f2% -gravity center label:"-colors %f2%" -append +repage ) ^
    -delete 0 ^
    +append +repage ^
  ) ^
  ( -clone 0 ^
    ( -clone 0 %OPTIONS% -colors %f3% -gravity center label:"-colors %f3%" -append +repage ) ^
    ( -clone 0 %OPTIONS% -colors %f4% -gravity center label:"-colors %f4%" -append +repage ) ^
    ( -clone 0 %OPTIONS% -colors %f5% -gravity center label:"-colors %f5%" -append +repage ) ^
    -delete 0 ^
    +append +repage ^
  ) ^
  ( -clone 0 ^
    ( -clone 0 %OPTIONS% -colors %f6% -gravity center label:"-colors %f6%" -append +repage ) ^
    ( -clone 0 %OPTIONS% -colors %f7% -gravity center label:"-colors %f7%" -append +repage ) ^
    ( -clone 0 %OPTIONS% -colors %f8% -gravity center label:"-colors %f8%" -append +repage ) ^
    -delete 0 ^
    +append +repage ^
  ) ^
  -delete 0 ^
  -append +repage ^
  %OUTFILE%

call echoRestore

All images on this page were created by the commands shown (except that to conserve bandwidth some PNG files were sed to JPG), using:

%IMG7%magick -version
Version: ImageMagick 7.1.0-42 Q16-HDRI x64 396d87c:20220709 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenCL 
Delegates (built-in): bzlib cairo freetype gslib heic jng jp2 jpeg jxl lcms lqr lzma openexr pangocairo png ps raqm raw rsvg tiff webp xml zip zlib
Compiler: Visual Studio 2022 (193231332)

Source file for this web page is panel9.h1. Execute "panel9.bat" to check that all scripts are illustrated on this page and create panel9.zip. To re-create this web page, execute "procH1 panel9".


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 2-Feb-2014.

Page created 26-Aug-2022 00:34:16.

Copyright © 2022 Alan Gibson.