snibgo's ImageMagick pages

Compiling IM with Cygwin

IM can be compiled with Cygwin tools.

The ImageMagick developers helpfully provide pre-built IM binaries that work fine under Windows. Why would you want to compile it yourself?

This page is based on a download of ImageMagick on 30 July 2014, v6.8.9-6, with Cygwin bash, on a 64-bit Windows 8.1 computer.

Relevant official IM documentation is:

Install Cygwin

I suggest you follow the instructions on my IM with Cygwin page. I installed the complete binary Cygwin "Devel" (development) package, to ensure I had make, the compiler and linker and so on. Probably not all components are required.

You can download ImageMagick source from the Cygwin distribution, but I strongly suggest that you don't. The source from Cygwin is v6.7.6.3-4, where the official IM distribution is v6.8.9-6. The Cygwin distro of IM is more than two years old.

Ensure the directories for the Cygwin binaries are on the system Path.

On this page, I prefix bash commands with a dollar, "$". This is the usual bash prompt. Don't type it.

Which version?

The official IM page Install ImageMagick from Source has two sets of source code that can be compiled under the Cygwin toolset under Windows. These are: "Unix Source", and "Windows Source".

This page describes how to build both versions. You only need one, of course. Which one is better? They seem to be functionally equivalent, with the same versions of the various libraries. Both versions include the libraries.

Commands to download and unpack are specific to the version. Commands to configure, make, and make install are common to both.

Downloading and building takes about 20 minutes. The "Windows Source" is slightly slower as it includes the source of the delegates, which also takes longer compile.

What installation directory?

By default, IM will install to the directory /usr/local/lib. However, I don't have permission to write to that directory:

$ echo Hello >/usr/local/lib/x.txt
bash: /usr/local/lib/x.txt: Permission denied

IM's build process won't discover this until after the configure and make, so if the install fails, we will need to repeat the configure and make.

The instructions on Install ImageMagick from Source say we should use sudo, but Cygwin doesn't have sudo. (This is weird. Perhaps it has some equivalent program? I don't know.)

Perhaps I could install as an Administrator, but I prefer not to.

Instead, I create a new directory that I will use for the installation. (Perhaps --disable-installed would be better.)

$ mkdir ~/iminst

Different versions of IM can be installed to different directories.

Building the Unix source

I download the source to my Cygwin home directory.

bash
$ cd ~
$ wget http://www.imagemagick.org/download/ImageMagick.tar.gz

This has downloaded the file ImageMagick.tar.gz, which is about 12 MB.

$ tar xvzf ImageMagick.tar.gz

This unpacks the distribution into directory ~/ImageMagick-6.8.9-6 and subdirectories.

$ cd ImageMagick-6.8.9-6
$ ./configure --prefix=/home/Alan/iminst --with-quantum-depth=32 --enable-hdri --with-jp2=yes --with-rsvg=yes --with-windows-font-dir=/cygdrive/c/Windows/Fonts

(The ./configure command is a bit messy, so I generally have a file named imconf.sh as required in each build directory.)

I tell configure the directory where the installation is to go. I choose Q32 because I've never used Q32, and I want to try it. I want HDRI. I tell it where Windows font files are kept.

Configure takes a couple of minutes. At the end, it spits out this:

ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

Host system type: x86_64-unknown-cygwin
Build system type: x86_64-unknown-cygwin

                  Option                        Value
-------------------------------------------------------------------------------
Shared libraries  --enable-shared=yes           yes
Static libraries  --enable-static=yes           yes
Module support    --with-modules=no             no
GNU ld            --with-gnu-ld=yes             yes
Quantum depth     --with-quantum-depth=32       32
High Dynamic Range Imagery
                  --enable-hdri=yes             yes

Install documentation:          yes

Delegate Configuration:
BZLIB             --with-bzlib=yes              yes
Autotrace         --with-autotrace=no           no
Dejavu fonts      --with-dejavu-font-dir=default        none
DJVU              --with-djvu=yes               no
DPS               --with-dps=yes                no
FFTW              --with-fftw=yes               no
FlashPIX          --with-fpx=yes                yes
FontConfig        --with-fontconfig=yes         yes
FreeType          --with-freetype=yes           yes
GhostPCL          None                          pcl6 (unknown)
GhostXPS          None                          gxps (unknown)
Ghostscript       None                          gs (9.06)
Ghostscript fonts --with-gs-font-dir=default    /usr/share/ghostscript/fonts/
Ghostscript lib   --with-gslib=no               no
Graphviz          --with-gvc=no
JBIG              --with-jbig=yes               yes
JPEG v1           --with-jpeg=yes               yes
JPEG-2000         --with-jp2=
LCMS v1           --with-lcms=no                no
LCMS v2           --with-lcms2=yes              yes
LQR               --with-lqr=yes                no
LTDL              --with-ltdl=yes               no
LZMA              --with-lzma=yes               yes
Magick++          --with-magick-plus-plus=yes   yes
OpenEXR           --with-openexr=yes            no
OpenJP2           --with-openjp2=yes            no
PANGO             --with-pango=yes              no
PERL              --with-perl=no                no
PNG               --with-png=yes                yes
RSVG              --with-rsvg=no                no
TIFF              --with-tiff=yes               yes
WEBP              --with-webp=yes               no
Windows fonts     --with-windows-font-dir=      none
WMF               --with-wmf=no         no
X11               --with-x=                     yes
XML               --with-xml=yes                no
ZLIB              --with-zlib=yes               yes

X11 Configuration:
      X_CFLAGS        =
      X_PRE_LIBS      = -lSM -lICE
      X_LIBS          =
      X_EXTRA_LIBS    =

Options used to compile and link:
  PREFIX          = /home/Alan/iminst
  EXEC-PREFIX     = /home/Alan/iminst
  VERSION         = 6.8.9
  CC              = gcc -std=gnu99 -std=gnu99
  CFLAGS          = -I/usr/include/freetype2 -I/usr/include/libpng15 -fopenmp -g -O2 -Wall -march=core2 -fexceptions -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32
  CPPFLAGS        = -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/freetype2 -I/usr/include/libpng15 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32
  PCFLAGS         =
  DEFS            = -DHAVE_CONFIG_H
  LDFLAGS         =
  LIBS            =
  CXX             = g++
  CXXFLAGS        = -g -O2
  FEATURES        = DPC HDRI OpenMP
  DELEGATES       = bzlib mpeg fpx fontconfig freetype jbig jng jpeg lcms lzma png ps tiff x zlib

It seems that the formats I care most about (jpeg, png, tiff, ps) should work.

$ make

Make raised many warnings, which I ignore. It finishes with:

 CC       utilities/animate.o
  CCLD     utilities/animate.exe
  CC       utilities/compare.o
  CCLD     utilities/compare.exe
  CC       utilities/composite.o
  CCLD     utilities/composite.exe
  CC       utilities/conjure.o
  CCLD     utilities/conjure.exe
  CC       utilities/convert.o
  CCLD     utilities/convert.exe
  CC       utilities/display.o
  CCLD     utilities/display.exe
  CC       utilities/identify.o
  CCLD     utilities/identify.exe
  CC       utilities/import.o
  CCLD     utilities/import.exe
  CC       utilities/mogrify.o
  CCLD     utilities/mogrify.exe
  CC       utilities/montage.o
  CCLD     utilities/montage.exe
  CC       utilities/stream.o
  CCLD     utilities/stream.exe
cp -f magick/ImageMagick.pc magick/ImageMagick-6.Q32HDRI.pc
cp -f magick/MagickCore.pc magick/MagickCore-6.Q32HDRI.pc
cp -f wand/MagickWand.pc wand/MagickWand-6.Q32HDRI.pc
cp -f wand/Wand.pc wand/Wand-6.Q32HDRI.pc
cp -f Magick++/lib/Magick++.pc Magick++/lib/Magick++-6.Q32HDRI.pc
cp -f Magick++/lib/ImageMagick++.pc Magick++/lib/ImageMagick++-6.Q32HDRI.pc
make[1]: Leaving directory '/home/Alan/ImageMagick-6.8.9-6'

It has created binaries in subdirectory utilities. I can verify them:

$ utilities/convert.exe logo: l.png

This creates l.png, the familiar logo.

However, that program can't see IM's xml files. It needs to be installed properly.

$ make install

The last few lines are:

 /usr/bin/mkdir -p '/home/Alan/iminst/lib/pkgconfig'
 /usr/bin/install -c -m 644 magick/ImageMagick.pc magick/MagickCore.pc magick/Im
ageMagick-6.Q32HDRI.pc magick/MagickCore-6.Q32HDRI.pc wand/MagickWand.pc wand/Wa
nd.pc wand/MagickWand-6.Q32HDRI.pc wand/Wand-6.Q32HDRI.pc Magick++/lib/Magick++.
pc Magick++/lib/ImageMagick++.pc Magick++/lib/Magick++-6.Q32HDRI.pc Magick++/lib
/ImageMagick++-6.Q32HDRI.pc '/home/Alan/iminst/lib/pkgconfig'
 /usr/bin/mkdir -p '/home/Alan/iminst/include/ImageMagick-6/wand'
 /usr/bin/install -c -m 644 wand/MagickWand.h wand/animate.h wand/compare.h wand
/composite.h wand/conjure.h wand/convert.h wand/deprecate.h wand/display.h wand/
drawing-wand.h wand/identify.h wand/import.h wand/magick-image.h wand/magick-pro
perty.h wand/magick-wand.h wand/magick_wand.h wand/method-attribute.h wand/mogri
fy.h wand/montage.h wand/pixel-iterator.h wand/pixel-wand.h wand/stream.h wand/w
and-view.h '/home/Alan/iminst/include/ImageMagick-6/wand'
make[2]: Leaving directory '/home/Alan/ImageMagick-6.8.9-6'
make[1]: Leaving directory '/home/Alan/ImageMagick-6.8.9-6'

Building the Windows source

$ wget http://www.imagemagick.org/download/windows/ImageMagick-windows.zip

At 68 MB, this is five times the size of the Unix source. It contains source code for the delegates. To keep the Windows source code separate from the Unix source code, I make a subdirectory winim, change to that directory, and build from there.

$ cd ~
$ mkdir winim
$ cd winim
$ unzip  ../ImageMagick-windows.zip
$ cd ImageMagick-6.8.9
$ ./configure --prefix=/home/Alan/iminstw --with-quantum-depth=32 --enable-hdri --with-jp2=yes --with-rsvg=yes --with-windows-font-dir=/cygdrive/c/Windows/Fonts

We need to give the Windows font in Cygwin format. If we give C:\Windows\Fonts, the backslashes are stripped out. Perhaps this could be cured by quoting it.

ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

Host system type: x86_64-unknown-cygwin
Build system type: x86_64-unknown-cygwin

                  Option                        Value
-------------------------------------------------------------------------------
Shared libraries  --enable-shared=yes           yes
Static libraries  --enable-static=yes           yes
Module support    --with-modules=no             no
GNU ld            --with-gnu-ld=yes             yes
Quantum depth     --with-quantum-depth=32       32
High Dynamic Range Imagery
                  --enable-hdri=yes             yes

Install documentation:          yes

Delegate Configuration:
BZLIB             --with-bzlib=yes              yes
Autotrace         --with-autotrace=no           no
Dejavu fonts      --with-dejavu-font-dir=default        none
DJVU              --with-djvu=yes               no
DPS               --with-dps=yes                no
FFTW              --with-fftw=yes               no
FlashPIX          --with-fpx=yes                yes
FontConfig        --with-fontconfig=yes         yes
FreeType          --with-freetype=yes           yes
GhostPCL          None                          pcl6 (unknown)
GhostXPS          None                          gxps (unknown)
Ghostscript       None                          gs (9.06)
Ghostscript fonts --with-gs-font-dir=default    /usr/share/ghostscript/fonts/
Ghostscript lib   --with-gslib=no               no
Graphviz          --with-gvc=no
JBIG              --with-jbig=yes               yes
JPEG v1           --with-jpeg=yes               yes
JPEG-2000         --with-jp2=
LCMS v1           --with-lcms=no                no
LCMS v2           --with-lcms2=yes              yes
LQR               --with-lqr=yes                no
LTDL              --with-ltdl=yes               no
LZMA              --with-lzma=yes               yes
Magick++          --with-magick-plus-plus=yes   yes
OpenEXR           --with-openexr=yes            no
OpenJP2           --with-openjp2=yes            no
PANGO             --with-pango=yes              no
PERL              --with-perl=no                no
PNG               --with-png=yes                yes
RSVG              --with-rsvg=no                no
TIFF              --with-tiff=yes               yes
WEBP              --with-webp=yes               no
Windows fonts     --with-windows-font-dir=/cygdrive/c/Windows/Fonts     /cygdrive/c/Windows/Fonts/
WMF               --with-wmf=no         no
X11               --with-x=                     yes
XML               --with-xml=yes                no
ZLIB              --with-zlib=yes               yes

X11 Configuration:
      X_CFLAGS        =
      X_PRE_LIBS      = -lSM -lICE
      X_LIBS          =
      X_EXTRA_LIBS    =

Options used to compile and link:
  PREFIX          = /home/Alan/iminstw
  EXEC-PREFIX     = /home/Alan/iminstw
  VERSION         = 6.8.9
  CC              = gcc -std=gnu99 -std=gnu99
  CFLAGS          = -I/usr/include/freetype2 -I/usr/include/libpng15 -fopenmp -g -O2 -Wall -march=core2 -fexceptions -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32
  CPPFLAGS        = -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/freetype2 -I/usr/include/libpng15 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32
  PCFLAGS         =
  DEFS            = -DHAVE_CONFIG_H
  LDFLAGS         =
  LIBS            =
  CXX             = g++
  CXXFLAGS        = -g -O2
  FEATURES        = DPC HDRI OpenMP
  DELEGATES       = bzlib mpeg fpx fontconfig freetype jbig jng jpeg lcms lzma png ps tiff x zlib
$ make
 CC       utilities/animate.o
  CCLD     utilities/animate.exe
  CC       utilities/compare.o
  CCLD     utilities/compare.exe
  CC       utilities/composite.o
  CCLD     utilities/composite.exe
  CC       utilities/conjure.o
  CCLD     utilities/conjure.exe
  CC       utilities/convert.o
  CCLD     utilities/convert.exe
  CC       utilities/display.o
  CCLD     utilities/display.exe
  CC       utilities/identify.o
  CCLD     utilities/identify.exe
  CC       utilities/import.o
  CCLD     utilities/import.exe
  CC       utilities/mogrify.o
  CCLD     utilities/mogrify.exe
  CC       utilities/montage.o
  CCLD     utilities/montage.exe
  CC       utilities/stream.o
  CCLD     utilities/stream.exe
cp -f magick/ImageMagick.pc magick/ImageMagick-6.Q32HDRI.pc
cp -f magick/MagickCore.pc magick/MagickCore-6.Q32HDRI.pc
cp -f wand/MagickWand.pc wand/MagickWand-6.Q32HDRI.pc
cp -f wand/Wand.pc wand/Wand-6.Q32HDRI.pc
cp -f Magick++/lib/Magick++.pc Magick++/lib/Magick++-6.Q32HDRI.pc
cp -f Magick++/lib/ImageMagick++.pc Magick++/lib/ImageMagick++-6.Q32HDRI.pc
make[1]: Leaving directory '/home/Alan/winim/ImageMagick-6.8.9'
$ make install

Run IM

I can run this program from a different Windows command console:

set IMCC=c:\cygwin64\home\Alan\iminst\bin\

%IMCC%convert -version 
Version: ImageMagick 6.8.9-6 Q32 x86_64 2014-07-30 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC HDRI OpenMP
Delegates: bzlib fontconfig freetype fpx jbig jng jpeg lcms lzma png tiff x zlib
del ci_rose.jpg
%IMCC%convert rose: ci_rose.jpg
ci_rose.jpg

convert.exe is not a conventional Windows program. Nor is it exactly Unix. It is, for want of a better term, a Cygwin program. For example, when I run my usual Windows version of convert like this...

F:\web\im>%IM%convert.exe logo: \web\im\u.png

... it simply runs and makes the required output.

My brand new convert.exe does this:

F:\web\im>%IMC%convert.exe logo: \web\im\u.png
cygwin warning:
  MS-DOS style path detected: \web\im\u.png
  Preferred POSIX equivalent is: /cygdrive/f/web/im/u.png
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

Cygwin's convert.exe has seen the backslashes, realised this is Windows-style, and translated it to Unix-style. I suppose this translation occurs in the standard system librares linked-in during the build. If I use forward slashes, this happens:

F:\web\im>%IM%convert.exe logo: /web/im/u.png

F:\web\im>%IMC%convert.exe logo: /web/im/u.png
convert: UnableToOpenBlob `/web/im/u.png': No such file or directory @ error/blob.c/OpenBlob/2658.
convert: WriteBlob Failed `/web/im/u.png' @ error/png.c/MagickPNGErrorHandler/1805.

The conventional Windows program works because Windows can often accept forward-slash instead of the more correct backslash. But the Cygwin version fails. This is because /web/im/u.png is a valid Unix-style filename, so it doesn't try to translate it from Windows style and the Unix directory /web/im doesn't exist.

There is a problem with device names in image filenames:

F:\prose\PICTURES>echo %TEMP%
C:\Users\Alan\AppData\Local\Temp

F:\prose\PICTURES>%IMCU%convert rose: %TEMP%\r.jpg
convert: unable to open image `\Users\Alan\AppData\Local\Temp\r.jpg': No such file or directory @ error/blob.c/OpenBlob/2658.

convert has dopped the C:. Running it with -debug all shows that convert has been given the proper path. The problem may lie in magick\magick.c which contains IsMagickConflict(), which calls NTIsMagickConflict, but only if MAGICKCORE_WINDOWS_SUPPORT is defined. This is defined in magick\magickcore.h, if either WIN32 or WIN64 is defined. I can't see where these two come from.

My computer is 64 bit, so I run ...

set CFLAGS=-DWIN64

... before ./configure and make. But make fails with:

$ make
make  all-am
make[1]: Entering directory '/home/Alan/imdevsrc'
  CC       magick/magick_libMagickCore_6_Q32HDRI_la-animate.lo
In file included from magick/animate.c:42:0:
./magick/studio.h:100:21: fatal error: direct.h: No such file or directory
 # include <direct.h>

As a kludgy solution, I define an environment variable:

for /F "usebackq" %%L in (`cygpath -u %TEMP%`) do set CYGTEMP=%%L

echo %CYGTEMP% 
/cygdrive/c/Users/Alan/AppData/Local/Temp 

I have downloaded and built the Unix version. The Windows download shows the same problem.

Q32 HDRI tests

To show we really do have 32 bits, we do the same operation with Q16 then with Q32. The operation makes an image with two pixels, and reduces contrast by seven decimal places (three divisions by 100, then one division by 10). In Q16, the two pixels have become the same colour (going by the #-numbers). In Q32, the pixels are not quite the same.

F:\web\im>%IM%convert xc:black xc:white +level 50,51% +level 50,51% +level 50,51% +level 50,60% txt:
# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (55.05%,55.05%,55.05%)  #8CED8CED8CED  srgb(55.05%,55.05%,55.05%)
# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (55.05%,55.05%,55.05%)  #8CED8CED8CED  srgb(55.05%,55.05%,55.05%)

F:\web\im>%IMCC%convert xc:black xc:white +level 50,51% +level 50,51% +level 50,51% +level 50,60% txt:
# ImageMagick pixel enumeration: 1,1,4294967295,srgb
0,0: (55.0505%,55.0505%,55.0505%)  #8CEDE5008CEDE5008CEDE500  srgb(55.0505%,55.0505%,55.0505%)
# ImageMagick pixel enumeration: 1,1,4294967295,srgb
0,0: (55.0505%,55.0505%,55.0505%)  #8CEDE7008CEDE7008CEDE700  srgb(55.0505%,55.0505%,55.0505%)

The operation -evaluate Pow N can clip pixels. When N > 1, pixels that are close to zero can be clipped to zero. The round-trip -evaluate Pow N -evaluate Pow 1/N should get back where we started, in this case a smooth gradient.

Q16:

%IM%convert ^
  -size 1x256 gradient: -rotate 90 ^
  -evaluate Pow 40 ^
  -evaluate Pow 0.025 ^
  ci_grad16.png

call %PICTBAT%graph1d ci_grad16.png
ci_grad16_g1d.png

Q32 HDRI:

%IMCW%convert ^
  -size 1x256 gradient: -rotate 90 ^
  -evaluate Pow 40 ^
  -evaluate Pow 0.025 ^
  ci_gradHDRI.png

call %PICTBAT%graph1d ci_gradHDRI.png
ci_gradHDRI_g1d.png

Q8:

%IMG8%convert ^
  -size 1x256 gradient: -rotate 90 ^
  -evaluate Pow 40 ^
  -evaluate Pow 0.025 ^
  ci_grad8.png

call %PICTBAT%graph1d ci_grad8.png
ci_grad8_g1d.png

The Q8 version is twice as bad as Q16. Q32 HDRI is a big improvement.

Upgrading to a newer IM version

From time to time, the ImageMagick developers release new versions. This is how I upgraded to v6.9.0-0. Installing the Windows binary is trivial, of course. Rebuilding from source is slightly more complex.

C:\cygwin64\home\Alan>wget http://www.imagemagick.org/download/windows/ImageMagick-windows.zip
C:\cygwin64\home\Alan>ren ImageMagick-windows.zip ImageMagick-windows-6900.zip
C:\cygwin64\home\Alan>unzip ImageMagick-windows-6900.zip
C:\cygwin64\home\Alan>ren ImageMagick-6.9.0 ImageMagick-6.9.0-0
C:\cygwin64\home\Alan>cd ImageMagick-6.9.0-0
C:\cygwin64\home\Alan>bash

$ ./configure --prefix=/home/Alan/iminstw --with-quantum-depth=32 --enable-hdri --with-rsvg=yes --with-windows-font-dir=/cygdrive/c/Windows/Fonts --disable-docs --with-modules

The bottom of the ./configure output says:

ImageMagick is configured as follows. Please verify that this configuration matches your expectations.

Host system type: x86_64-unknown-cygwin
Build system type: x86_64-unknown-cygwin

                  Option                        Value
-------------------------------------------------------------------------------
Shared libraries  --enable-shared=yes           yes
Static libraries  --enable-static=yes           yes
Module support    --with-modules=yes            yes
GNU ld            --with-gnu-ld=yes             yes
Quantum depth     --with-quantum-depth=32       32
High Dynamic Range Imagery
                  --enable-hdri=yes             yes

Install documentation:          no

Delegate Configuration:
BZLIB             --with-bzlib=yes              yes
Autotrace         --with-autotrace=no           no
Dejavu fonts      --with-dejavu-font-dir=default        none
DJVU              --with-djvu=yes               no
DPS               --with-dps=yes                no
FFTW              --with-fftw=yes               no
FlashPIX          --with-fpx=yes                yes
FontConfig        --with-fontconfig=yes         yes
FreeType          --with-freetype=yes           yes
GhostPCL          None                          pcl6 (unknown)
GhostXPS          None                          gxps (unknown)
Ghostscript       None                          gs (9.06)
Ghostscript fonts --with-gs-font-dir=default    /usr/share/ghostscript/fonts/
Ghostscript lib   --with-gslib=no               no
Graphviz          --with-gvc=no
JBIG              --with-jbig=yes               yes
JPEG v1           --with-jpeg=yes               yes
JPEG-2000         --with-jp2=
LCMS v1           --with-lcms=no                no
LCMS v2           --with-lcms2=yes              yes
LQR               --with-lqr=yes                no
LTDL              --with-ltdl=yes               yes
LZMA              --with-lzma=yes               yes
Magick++          --with-magick-plus-plus=yes   yes
OpenEXR           --with-openexr=yes            no
OpenJP2           --with-openjp2=yes            no
PANGO             --with-pango=yes              no
PERL              --with-perl=no                no
PNG               --with-png=yes                yes
RSVG              --with-rsvg=yes               no
TIFF              --with-tiff=yes               yes
WEBP              --with-webp=yes               no
Windows fonts     --with-windows-font-dir=/cygdrive/c/Windows/Fonts     /cygdrive/c/Windows/Fonts/
WMF               --with-wmf=no         no
X11               --with-x=                     yes
XML               --with-xml=yes                no
ZLIB              --with-zlib=yes               yes

X11 Configuration:
      X_CFLAGS        =
      X_PRE_LIBS      = -lSM -lICE
      X_LIBS          =
      X_EXTRA_LIBS    =

Options used to compile and link:
  PREFIX          = /home/Alan/iminstw
  EXEC-PREFIX     = /home/Alan/iminstw
  VERSION         = 6.9.0
  CC              = gcc -std=gnu99 -std=gnu99
  CFLAGS          = -I/usr/include/freetype2 -I/usr/include/libpng15 -fopenmp -g -O2 -Wall -march=core2 -fexceptions -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32
  CPPFLAGS        = -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32
  PCFLAGS         =
  DEFS            = -DHAVE_CONFIG_H
  LDFLAGS         =
  LIBS            =
  CXX             = g++
  CXXFLAGS        = -g -O2
  FEATURES        = DPC HDRI OpenMP Modules
  DELEGATES       = bzlib mpeg fpx fontconfig freetype jbig jng jpeg lcms lzma png ps tiff x zlib
$ make
$ make install
$ exit

Verify the installation:

C:\cygwin64\home\Alan\ImageMagick-6.9.0>..\iminstw\bin\convert -version
Version: ImageMagick 6.9.0-0 Q32 x86_64 2014-11-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC HDRI OpenMP
Delegates (built-in): bzlib fontconfig freetype fpx jbig jng jpeg lcms lzma png tiff x zlib

I have written a number of process modules. (See my page Process modules.) I want these to be available in the new IM build.

First, we copy the source code.

xcopy ..\imdevsrc\filters\*.c filters\
xcopy ..\imdevsrc\filters\*.h filters\

(Don't overwrite any files.)

We edit filters\makefile.am, adding in any stuff we added to ..\imdevsrc\filters\makefile.am.

If we hadn't used --with-modules, we would also need to edit magick/module.c and magick/static.c,

Then we rebuild IM. As we are now merely adding modules, we can skip autoconf and ./configure, so make is quick.

bash
$ automake
$ make
$ make install
$ exit

Check that IM can see the modules:

..\iminstw\bin\convert -list module
Path: /home/Alan/iminstw/lib/ImageMagick-6.9.0//modules-Q32HDRI/filters

Image Filter
-------------------------------------------------------------------------------
addend
analyze
applines
cumulhisto
drawcirc
dumpimage
echostuff
eqfish2rect
geodist
grad2
growcut
hellow
img2knl
invclut
mkgauss
mkhisto
onewhite
rect2eqfish
replaceall
replaceeach
replacefirst
replacelast
replacespec
segscanmerge
sortlines
sortpixels

Upgrading again

For my development work, I've been using IM v6.9.0-0 for some months. It doesn't include some new features that I need. It is time to upgrade again.

From Install from Windows Source , I download ImageMagick-windows.zip.

Unzip it to a new directory c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\. It takes about 450 MB. That directory now contains sub-directories for delegates, and sub-directory VisualMagick for building with Microsoft software, and sub-directory ImageMagick which contains the IM source and files required for a Cygwin build.

cd c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick

Environment variable %IMSRC% is currently:

IMSRC=c:\cygwin64\home\Alan\ImageMagick-6.9.0-0

%IMSRC%\filters contains source for my process modules. %IMSRC%\snibgo contains various *.c and *.sh and files. %IMSRC% contains some *.h and files.

c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick>xcopy %IMSRC%\filters\*.c filters\
c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick>xcopy %IMSRC%\filters\*.inc filters\
c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick>xcopy %IMSRC%\filters\*.h filters\
c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick>xcopy %IMSRC%\filters\*.am filters\
c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick>xcopy %IMSRC%\snibgo\*.c snibgo\
c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick>xcopy %IMSRC%\snibgo\*.sh snibgo\
c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick>xcopy %IMSRC%\*.h .
bash
# automake

(This gives a message: "sh: gitversion: command not found".)

# autoconf

# ./configure --prefix=/home/Alan/imdevins6937 --with-quantum-depth=32 --enable-hdri --with-rsvg=yes --with-windows-font-dir=/cygdrive/c/Windows/Fonts --disable-docs --with-modules
==============================================================================
ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

  Host system type: x86_64-unknown-cygwin
  Build system type: x86_64-unknown-cygwin

                 Option                        Value
  ------------------------------------------------------------------------------

  Shared libraries  --enable-shared=yes         yes
  Static libraries  --enable-static=yes         yes
  Module support    --with-modules=yes          yes
  GNU ld            --with-gnu-ld=yes           yes
  Quantum depth     --with-quantum-depth=32     32
  High Dynamic Range Imagery
                    --enable-hdri=yes           yes

  Install documentation:                        no

  Delegate Library Configuration:
  BZLIB             --with-bzlib=yes            yes
  Autotrace         --with-autotrace=no         no
  DJVU              --with-djvu=yes             no
  DPS               --with-dps=yes              no
  FFTW              --with-fftw=yes             yes
  FlashPIX          --with-fpx=yes              yes
  FontConfig        --with-fontconfig=yes       yes
  FreeType          --with-freetype=yes         yes
  Ghostscript lib   --with-gslib=no             no
  Graphviz          --with-gvc=yes              no
  JBIG              --with-jbig=yes             yes
  JPEG v1           --with-jpeg=yes             yes
  LCMS              --with-lcms=yes             yes
  LQR               --with-lqr=yes              no
  LTDL              --with-ltdl=yes             yes
  LZMA              --with-lzma=yes             yes
  Magick++          --with-magick-plus-plus=yes yes
  OpenEXR           --with-openexr=yes          no
  OpenJP2           --with-openjp2=yes          no
  PANGO             --with-pango=yes            yes
  PERL              --with-perl=no              no
  PNG               --with-png=yes              yes
  RAQM              --with-raqm=yes             no
  RSVG              --with-rsvg=yes             yes
  TIFF              --with-tiff=yes             yes
  WEBP              --with-webp=yes             yes
  WMF               --with-wmf=yes              yes
  X11               --with-x=                   yes
  XML               --with-xml=yes              yes
  ZLIB              --with-zlib=yes             yes

  Delegate Program Configuration:
  GhostPCL          None                                pcl6 (unknown)
  GhostXPS          None                                gxps (unknown)
  Ghostscript       None                                gs (9.15)

  Font Configuration:
  Apple fonts       --with-apple-font-dir=default
  Dejavu fonts      --with-dejavu-font-dir=default      none
  Ghostscript fonts --with-gs-font-dir=default  /usr/share/ghostscript/fonts/
  Windows fonts     --with-windows-font-dir=/cygdrive/c/Windows/Fonts   /cygdriv
e/c/Windows/Fonts/

  X11 Configuration:
        X_CFLAGS        =
        X_PRE_LIBS      =  -lSM -lICE
        X_LIBS          =
        X_EXTRA_LIBS    =

  Options used to compile and link:
    PREFIX          = /home/Alan/imdevins6937
    EXEC-PREFIX     = /home/Alan/imdevins6937
    VERSION         = 6.9.3
    CC              = gcc -std=gnu99 -std=gnu99
    CFLAGS          = -I/usr/include/libxml2  -I/usr/include/cairo -I/usr/includ
e/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/fr
eetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16
  -D_REENTRANT -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/i
nclude/libpng16 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0
/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng1
6 -I/usr/include/freetype2 -I/usr/include/libpng16  -I/usr/include/libpng16   -D
_REENTRANT -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1
 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/us
r/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/i
nclude/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16    -I/usr/inclu
de/freetype2 -I/usr/include/libpng16  -I/usr/include/freetype2 -I/usr/include/li
bpng16 -I/usr/include/freetype2 -I/usr/include/libpng16     -fopenmp -g -O2 -Wal
l -mtune=haswell -fexceptions  -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_D
EPTH=32
    CPPFLAGS        =   -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32

    PCFLAGS         =
    DEFS            = -DHAVE_CONFIG_H
    LDFLAGS         =
    LIBS            =
    CXX             = g++
    CXXFLAGS        = -g -O2
    FEATURES        = DPC HDRI Cipher OpenMP Modules
    DELEGATES       = bzlib mpeg fftw fpx fontconfig freetype jbig jng jpeg lcms
 lzma pango png ps rsvg tiff webp wmf x xml zlib
==============================================================================

Finish the build:

# make
# make install
# exit

Set the new values of environment variables.

set IMDEV=C:\cygwin64\home\Alan\imdevins6937\bin\ set IMFILTSRC=C:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick\filters\ set IMSRC=c:\cygwin64\home\Alan\ImageMagick-6.9.3-7\ImageMagick

Installing V7

Installing a development environment for v7 works in a similar way. I need parallel development of both v6 and v7, with both builds using a single version of my own source code.

Unzip the 103 MB zip file to c:\cygwin64\home\Alan\imagemagick-7.0.1-0\.

Set IM7SRC.

Copy my source files from v6 directories to v7. This could be done with symbolic links, but I prefer physically separate files.

call %PICTBAT%snibSrc6to7

cd %IM7SRC%

bash

# ./configure --prefix=/home/Alan/imdevins7010 --with-quantum-depth=32 --enable-hdri --with-rsvg=yes --with-windows-font-dir=/cygdrive/c/Windows/Fonts --disable-docs --with-modules --enable-legacy-support

This shows:

ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

  Host system type: x86_64-unknown-cygwin
  Build system type: x86_64-unknown-cygwin

                 Option                        Value
  ------------------------------------------------------------------------------
  Shared libraries  --enable-shared=yes		yes
  Static libraries  --enable-static=yes		yes
  Module support    --with-modules=yes		yes
  GNU ld            --with-gnu-ld=yes		yes
  Quantum depth     --with-quantum-depth=32	32
  High Dynamic Range Imagery
                    --enable-hdri=yes		yes

  Install documentation:			yes

  Delegate Library Configuration:
  BZLIB             --with-bzlib=yes		yes
  Autotrace         --with-autotrace=no		no
  DJVU              --with-djvu=yes		no
  DPS               --with-dps=yes		no
  FFTW              --with-fftw=yes		yes
  FLIF              --with-flif=yes		no
  FlashPIX          --with-fpx=yes		yes
  FontConfig        --with-fontconfig=yes	yes
  FreeType          --with-freetype=yes		yes
  Ghostscript lib   --with-gslib=no		no
  Graphviz          --with-gvc=yes		no
  JBIG              --with-jbig=yes		yes
  JPEG v1           --with-jpeg=yes		yes
  LCMS              --with-lcms=yes		yes
  LQR               --with-lqr=yes		no
  LTDL              --with-ltdl=yes		yes
  LZMA              --with-lzma=yes		yes
  Magick++          --with-magick-plus-plus=yes	yes
  OpenEXR           --with-openexr=yes		no
  OpenJP2           --with-openjp2=yes		no
  PANGO             --with-pango=yes		yes
  PERL              --with-perl=no		no
  PNG               --with-png=yes		yes
  RAQM              --with-raqm=yes		no
  RSVG              --with-rsvg=yes		yes
  TIFF              --with-tiff=yes		yes
  WEBP              --with-webp=yes		yes
  WMF               --with-wmf=yes		yes
  X11               --with-x=			yes
  XML               --with-xml=yes		yes
  ZLIB              --with-zlib=yes		yes

  Delegate Program Configuration:
  GhostPCL          None				pcl6 (unknown)
  GhostXPS          None				gxps (unknown)
  Ghostscript       None				gs (9.15)

  Font Configuration:
  Apple fonts       --with-apple-font-dir=default	
  Dejavu fonts      --with-dejavu-font-dir=default	none
  Ghostscript fonts --with-gs-font-dir=default	/usr/share/ghostscript/fonts/
  Windows fonts     --with-windows-font-dir=/cygdrive/c/Windows/Fonts	/cygdrive/c/Windows/Fonts/

  X11 Configuration:
        X_CFLAGS        = 
        X_PRE_LIBS      =  -lSM -lICE
        X_LIBS          = 
        X_EXTRA_LIBS    = 

  Options used to compile and link:
    PREFIX          = /home/Alan/imdevins7010
    EXEC-PREFIX     = /home/Alan/imdevins7010
    VERSION         = 7.0.1
    CC              = gcc -std=gnu99 -std=gnu99
    CFLAGS          = -I/usr/include/libxml2  -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16  -D_REENTRANT -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16  -I/usr/include/libpng16   -D_REENTRANT -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16    -I/usr/include/freetype2 -I/usr/include/libpng16  -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16     -fopenmp -g -O2 -Wall -mtune=haswell -fexceptions  -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32
    CPPFLAGS        =   -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=32 
    PCFLAGS         = 
    DEFS            = -DHAVE_CONFIG_H
    LDFLAGS         =  
    LIBS            = 
    CXX             = g++
    CXXFLAGS        = -g -O2 
    FEATURES        = DPC HDRI Cipher OpenMP Modules
    DELEGATES       = bzlib mpeg fftw fpx fontconfig freetype jbig jng jpeg lcms lzma pango png ps rsvg tiff webp wmf x xml zlib

Finish the build:

# make
# make install
# exit
f:\web\im>%IM7DEV%magick -version
Version: ImageMagick 7.0.1-0 Q32 x86_64 2016-05-14 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo fftw fontconfig fpx freetype jbig jng jpeg lcms ltdl lzma pangocairo png rsvg tiff webp wmf x xml zlib

Varieties

The bash script instim8.sh builds eight varieties of IM: Q8, Q16, Q32 and Q64; and integer or floating-point.

bash
$ ./instim8.sh
$ exit

The Windows script setIm8.bat sets environment variables to use these varieties.

call %PICTBAT%setIm8

We can find the memory requirements, in bytes per channel per pixel:

call %PICTBAT%bytesPerCh
int fp
Q8 1 4
Q16 2 4
Q32 4 8
Q64 16 16

Currently, building a Q64 non-HDRI results in a Q64 HDRI variety.

%IM64i%convert xc: -process hellow NULL: |findstr HDRI 
Includes HDRI

We can compare the precision of the seven varieties:

set OPERATION=-evaluate Pow 40 -evaluate Pow 0.025

Q8 int:

%IM8i%convert ^
  -size 1x256 gradient: ^
  -rotate 90 ^
  %OPERATION% ^
  -format %%[fx:mean] -write info: ^
  ci_g8i.png 
0.13436
call %PICTBAT%graph1d ci_g8i.png
ci_g8i_g1d.png

Q8 float:

%IM8f%convert ^
  -size 1x256 gradient: ^
  -rotate 90 ^
  %OPERATION% ^
  -format %%[fx:mean] -write info: ^
  ci_g8f.png 
0.497918
call %PICTBAT%graph1d ci_g8f.png
ci_g8f_g1d.png

Q16 int:

%IM16i%convert ^
  -size 1x256 gradient: ^
  -rotate 90 ^
  %OPERATION% ^
  -format %%[fx:mean] -write info: ^
  ci_g16i.png 
0.225046
call %PICTBAT%graph1d ci_g16i.png
ci_g16i_g1d.png

Q16 float:

%IM16f%convert ^
  -size 1x256 gradient: ^
  -rotate 90 ^
  %OPERATION% ^
  -format %%[fx:mean] -write info: ^
  ci_g16f.png 
0.498392
call %PICTBAT%graph1d ci_g16f.png
ci_g16f_g1d.png

Q32 int:

%IM32i%convert ^
  -size 1x256 gradient: ^
  -rotate 90 ^
  %OPERATION% ^
  -format %%[fx:mean] -write info: ^
  ci_g32i.png 
0.342347
call %PICTBAT%graph1d ci_g32i.png
ci_g32i_g1d.png

Q32 float:

%IM32f%convert ^
  -size 1x256 gradient: ^
  -rotate 90 ^
  %OPERATION% ^
  -format %%[fx:mean] -write info: ^
  ci_g32f.png 
0.499999
call %PICTBAT%graph1d ci_g32f.png
ci_g32f_g1d.png

(integer Q64 is not available)

Q64 float:

%IM64f%convert ^
  -size 1x256 gradient: ^
  -rotate 90 ^
  %OPERATION% ^
  -format %%[fx:mean] -write info: ^
  ci_g64f.png 
0.5
call %PICTBAT%graph1d ci_g64f.png
ci_g64f_g1d.png

The seven versions of IM have created seven different results. In this test, all the HDRI varieties are more accurate than all the non-HDRI varieties.

Speed test

Timings from a speed trial imSpeeds.bat, with results in seconds, are:

int fp
Q8 75 82
Q16 83 84
Q32 108 116
Q64 217

HDRI and larger Q-numbers impose speed penalties. However, Q16f is hardly any slower than Q16i.

Scripts

instim8.sh

This bash script builds eight versions of IM. It is in the directory C:\cygwin64\home\Alan\. It assumes a distribution has been unpacked into %IMSRC%, eg ~/ImageMagick-6.8.9-6. It takes about 90 minutes to run. It doesn't check that the builds have succeeded.

cd ~
mkdir iminst8i
mkdir iminst16i
mkdir iminst32i
mkdir iminst64i
mkdir iminst8f
mkdir iminst16f
mkdir iminst32f
mkdir iminst64f

cd $IMSRC

export BASE_CONF='--with-rsvg=yes --with-windows-font-dir=/cygdrive/c/Windows/Fonts --disable-docs --with-modules'


# make distclean

./configure $BASE_CONF --prefix=/home/Alan/iminst8i --with-quantum-depth=8
make
make install

# make distclean

./configure $BASE_CONF --prefix=/home/Alan/iminst16i --with-quantum-depth=16
make
make install

# make distclean

./configure $BASE_CONF --prefix=/home/Alan/iminst32i --with-quantum-depth=32
make
make install

# make distclean

./configure $BASE_CONF --prefix=/home/Alan/iminst64i --with-quantum-depth=64
make
make install

# make distclean


./configure $BASE_CONF --prefix=/home/Alan/iminst8f --with-quantum-depth=8 --enable-hdri
make
make install

# make distclean

./configure $BASE_CONF --prefix=/home/Alan/iminst16f --with-quantum-depth=16 --enable-hdri
make
make install

# make distclean

./configure $BASE_CONF --prefix=/home/Alan/iminst32f --with-quantum-depth=32 --enable-hdri
make
make install

# make distclean

./configure $BASE_CONF --prefix=/home/Alan/iminst64f --with-quantum-depth=64 --enable-hdri
make
make install

# make distclean

cd ~

setIm8.bat

This cmd script creates enviroment variables for the eight versions of IM, and verifies that convert works for each. It is in the directory %PICTBAT%.

set IM8i=c:\cygwin64\home\Alan\iminst8i\bin\
set IM16i=c:\cygwin64\home\Alan\iminst16i\bin\
set IM32i=c:\cygwin64\home\Alan\iminst32i\bin\
set IM64i=c:\cygwin64\home\Alan\iminst64i\bin\
set IM8f=c:\cygwin64\home\Alan\iminst8f\bin\
set IM16f=c:\cygwin64\home\Alan\iminst16f\bin\
set IM32f=c:\cygwin64\home\Alan\iminst32f\bin\
set IM64f=c:\cygwin64\home\Alan\iminst64f\bin\

%IM8i%convert --version
if ERRORLEVEL 1 exit /B 1

%IM16i%convert --version
if ERRORLEVEL 1 exit /B 1

%IM32i%convert --version
if ERRORLEVEL 1 exit /B 1

%IM64i%convert --version
if ERRORLEVEL 1 exit /B 1

%IM8f%convert --version
if ERRORLEVEL 1 exit /B 1

%IM16f%convert --version
if ERRORLEVEL 1 exit /B 1

%IM32f%convert --version
if ERRORLEVEL 1 exit /B 1

%IM64f%convert --version
if ERRORLEVEL 1 exit /B 1

bytesPerCh.bat

Getting the results in the form of a table is slightly messy. Note that, in this compilation, -process hellow ends each line just with the single byte '\n', not the two bytes '\r\n'.

set OUT_LIS=bytesPerCh.csv

del %OUT_LIS% 2>nul
echo Q8 >>%OUT_LIS%
%IM8i%convert xc: -process hellow NULL: |findstr /C:"  Quantum" >>%OUT_LIS%
%IM8f%convert xc: -process hellow NULL: |findstr /C:"  Quantum" >>%OUT_LIS%
echo XXQ16 >>%OUT_LIS%
%IM16i%convert xc: -process hellow NULL: |findstr /C:"  Quantum" >>%OUT_LIS%
%IM16f%convert xc: -process hellow NULL: |findstr /C:"  Quantum" >>%OUT_LIS%
echo XXQ32 >>%OUT_LIS%
%IM32i%convert xc: -process hellow NULL: |findstr /C:"  Quantum" >>%OUT_LIS%
%IM32f%convert xc: -process hellow NULL: |findstr /C:"  Quantum" >>%OUT_LIS%
echo XXQ64 >>%OUT_LIS%
%IM64i%convert xc: -process hellow NULL: |findstr /C:"  Quantum" >>%OUT_LIS%
%IM64f%convert xc: -process hellow NULL: |findstr /C:"  Quantum" >>%OUT_LIS%

chBin   /p0 /i%OUT_LIS% /f\r
chBin   /p0 /i%OUT_LIS% /f\n
chStrs  /p0 /i%OUT_LIS% /fQuantum /t,
chStrs  /p0 /i%OUT_LIS% /f"  " /t" "
chBin   /p0 /i%OUT_LIS% /fXX /t\r\n
cPrefix /p0 /i%OUT_LIS% /t,int,fp

call csv2tab bytesPerCh

imSpeeds.bat

del speedTrial.lis

%IM8i%convert -version
%IM16i%convert -version
%IM32i%convert -version
%IM64i%convert -version
%IM8f%convert -version
%IM16f%convert -version
%IM32f%convert -version
%IM64f%convert -version

call %PICTBAT%imSpeedTrial %IM8i%
call %PICTBAT%imSpeedTrial %IM16i%
call %PICTBAT%imSpeedTrial %IM32i%
call %PICTBAT%imSpeedTrial %IM64i%
call %PICTBAT%imSpeedTrial %IM8f%
call %PICTBAT%imSpeedTrial %IM16f%
call %PICTBAT%imSpeedTrial %IM32f%
call %PICTBAT%imSpeedTrial %IM64f%

type speedTrial.lis

imSpeedTrial.bat

echo %1 >>speedTrial.lis

set OP=-size 7500x5000 ^
  xc:#f00 ^
  gradient:#0f0-#00f ^
  -compose Over -composite ^
  -blur 0x2 ^
  +level 10,20%% ^
  -sigmoidal-contrast 3,50%% ^
  -evaluate Pow 3 ^
  -colorspace RGB ^
  -colorspace sRGB


%1convert ^
  %OP% ^
  NULL:

call StopWatch

%1convert ^
  %OP% ^
  +delete ^
  %OP% ^
  +delete ^
  %OP% ^
  +delete ^
  %OP% ^
  +delete ^
  %OP% ^
  +delete ^
  %OP% ^
  +delete ^
  %OP% ^
  +delete ^
  %OP% ^
  +delete ^
  %OP% ^
  +delete ^
  %OP% ^
  NULL:

call StopWatch >>speedTrial.lis

All images on this page were created by the commands shown.

My usual version of IM is:

%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

One of the varieties shown here is is:

%IM32f%identify -version
Version: ImageMagick 6.9.0-0 Q32 x86_64 2015-02-28 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC HDRI Modules OpenMP
Delegates (built-in): bzlib fontconfig freetype fpx jbig jng jpeg lcms ltdl lzma png tiff x zlib

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


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 v2.0 23-November-2014.

Page created 27-May-2017 17:21:59.

Copyright © 2017 Alan Gibson.