1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="en" name="language">
<title>GraphicsMagick Windows Installation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link media="screen" href="docutils-articles.css" type="text/css" rel="stylesheet">
</head>
<body>
<div class="banner">
<img src="images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
<input type="hidden" name="domains" value="www.graphicsmagick.org" />
<input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" /> <input type="submit" name="sa" value="Search" /></span>
</form>
</div>
<div class="navmenu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="project.html">Project</a></li>
<li><a href="download.html">Download</a></li>
<li><a href="README.html">Install</a></li>
<li><a href="Hg.html">Source</a></li>
<li><a href="NEWS.html">News</a> </li>
<li><a href="utilities.html">Utilities</a></li>
<li><a href="programming.html">Programming</a></li>
<li><a href="reference.html">Reference</a></li>
</ul>
</div>
<div class="document" id="graphicsmagick-windows-installation">
<h1 class="title">GraphicsMagick Windows Installation</h1>
<!-- -*- mode: rst -*- -->
<!-- This text is in reStucturedText format, so it may look a bit odd. -->
<!-- See http://docutils.sourceforge.net/rst.html for details. -->
<div class="contents local topic" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#installing-using-installer-package" id="id1">Installing Using Installer Package</a></p>
<ul>
<li><p><a class="reference internal" href="#prerequisites" id="id2">Prerequisites</a></p></li>
<li><p><a class="reference internal" href="#retrieve-install-package" id="id3">Retrieve Install Package</a></p></li>
<li><p><a class="reference internal" href="#start-installation-wizard" id="id4">Start Installation Wizard</a></p></li>
<li><p><a class="reference internal" href="#read-installation-information" id="id5">Read Installation Information</a></p></li>
<li><p><a class="reference internal" href="#select-destination-directory" id="id6">Select Destination Directory</a></p></li>
<li><p><a class="reference internal" href="#select-start-menu-folder" id="id7">Select Start Menu Folder</a></p></li>
<li><p><a class="reference internal" href="#select-additional-tasks" id="id8">Select Additional Tasks</a></p></li>
<li><p><a class="reference internal" href="#ready-to-install" id="id9">Ready to Install</a></p></li>
<li><p><a class="reference internal" href="#installation-progress" id="id10">Installation Progress</a></p></li>
<li><p><a class="reference internal" href="#final-information" id="id11">Final Information</a></p></li>
<li><p><a class="reference internal" href="#finishing-up" id="id12">Finishing Up</a></p></li>
<li><p><a class="reference internal" href="#testing-the-installation" id="id13">Testing The Installation</a></p></li>
<li><p><a class="reference internal" href="#uninstall" id="id14">Uninstall</a></p></li>
<li><p><a class="reference internal" href="#use-from-another-package-or-program" id="id15">Use From Another Package or Program</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#installing-from-source-code" id="id16">Installing From Source Code</a></p>
<ul>
<li><p><a class="reference internal" href="#applicability" id="id17">Applicability</a></p></li>
<li><p><a class="reference internal" href="#important-notes" id="id18">Important Notes</a></p></li>
<li><p><a class="reference internal" href="#windows-xp-vista-7-visual-c-6-0-through-17-6-5-compilation" id="id19">Windows XP, Vista, 7 Visual C++ 6.0 through 17.6.5 Compilation</a></p></li>
<li><p><a class="reference internal" href="#environment-variables" id="id20">Environment Variables</a></p></li>
<li><p><a class="reference internal" href="#windows-distribution-build-procedure" id="id21">Windows Distribution Build Procedure</a></p></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installing-using-installer-package">
<h1><a class="toc-backref" href="#id1">Installing Using Installer Package</a></h1>
<blockquote>
<p>This section provides information specific to GraphicsMagick installed
via a "setup.exe" style installation wizard under Microsoft Windows. It
applies only to the pre-built "binaries" package, and not to versions
compiled from source code. If you would like to install GraphicsMagick
from source code, then please refer to the Installing From Source Code
section.</p>
</blockquote>
<div class="section" id="prerequisites">
<h2><a class="toc-backref" href="#id2">Prerequisites</a></h2>
<blockquote>
<p>While multiple versions of GraphicsMagick may be installed at one
time, if your intention is to replace a prior installation of
GraphicsMagick with a newer version, then it is wise to uninstall
the existing GraphicsMagick (see uninstall procedure) prior to
installing the newer version.</p>
<p>While it is not a requirement, it is strongly recommended that the
<a class="reference external" href="http://sourceforge.net/projects/ghostscript/">Ghostscript</a>
package (GraphicsMagick is tested with version 9.27) be
installed. GraphicsMagick uses Ghostscript to render Postscript and
PDF files, as well as formats where a translator to Postscript is
available. GraphicsMagick will use the <a class="reference external" href="http://sourceforge.net/projects/gs-fonts/">Ghostscript Fonts</a> (also known as "URW
Fonts") to support the standard set of Adobe Postscript fonts like
"Helvetica" and "Times Roman" if these fonts are not available as
TrueType fonts. The Ghostscript fonts need to manually installed
with administrator privileges in the Ghostscript installation
directory (e.g. as <span class="docutils literal"><span class="pre">C:\Program</span> Files\gs\fonts</span> or <span class="docutils literal">C:Program Files\gs\gs9.27\fonts</span>).</p>
<p>The algorithm used to find the fonts consults the Windows registry
to learn Ghostscript installation paths, and then looks for a
"fonts/n019003l.pfb" file in each path until it finds a match.</p>
<p>Make sure to install a Ghostscript which is compatible with the
GraphicsMagick you are installing. For example, if you are
installing a 64-bit GraphicsMagick, you should install a 64-bit
Ghostscript. The installation order of the two packages is not
important. Both 32 and 64-bit versions of GraphicsMagick and
Ghostscript may be installed at the same time.</p>
</blockquote>
</div>
<div class="section" id="retrieve-install-package">
<h2><a class="toc-backref" href="#id3">Retrieve Install Package</a></h2>
<blockquote>
<p>Retrieve the GraphicsMagick Windows binary install package from a one
of the ftp sites listed at the <a class="reference external" href="download.html">GraphicsMagick Download Sites</a> page. The available install packages are as follows</p>
<p>Windows Dynamic-Multithread (DLL-based) install package with utilities,
ImageMagickObject COM object, and web pages:</p>
<blockquote>
<pre class="literal-block">GraphicsMagick-1.3-Q8-win32-dll.exe
GraphicsMagick-1.3-Q16-win32-dll.exe
GraphicsMagick-1.3-Q8-win64-dll.exe
GraphicsMagick-1.3-Q16-win64-dll.exe</pre>
</blockquote>
<p>Note that the QuantumDepth=8 version (Q8) which provides industry
standard 24/32 bit pixels consumes half the memory and about 30% less
CPU than the QuantumDepth=16 version (Q16) which provides 48/64 bit
pixels for high-resolution color. A Q8 version is fine for processing
typical photos intended for viewing on a computer screen. If you are
dealing with film, scientific, or medical images, use ICC color
profiles, or deal with images that have limited contrast, then the Q16
version is recommended.</p>
<p>The <cite>win32</cite> packages are for 32-bit or 64-bit Windows, whereas the
<cite>win64</cite> packages are only for 64-bit Windows. The 64-bit version
allows processing larger images in memory (rather than disk files),
provided that the system has more than 2GB of RAM installed. Memory
access is 1000 times faster than disk access.</p>
</blockquote>
</div>
<div class="section" id="start-installation-wizard">
<h2><a class="toc-backref" href="#id4">Start Installation Wizard</a></h2>
<blockquote>
<p>Execute the downloaded file from your browser or by double-clicking on
the filename from within Windows Explorer. The GraphicsMagick Setup
Wizard will appear. Click on "<em>Next></em>" to continue.</p>
</blockquote>
</div>
<div class="section" id="read-installation-information">
<h2><a class="toc-backref" href="#id5">Read Installation Information</a></h2>
<blockquote>
<p>An informational screen is presented which provides a summary of things
you should know before you proceed. Please take care to read this
information. Once you have finished, Click on "<em>Next></em>" to continue.</p>
</blockquote>
</div>
<div class="section" id="select-destination-directory">
<h2><a class="toc-backref" href="#id6">Select Destination Directory</a></h2>
<blockquote>
<p>Specify what drive and directory to install GraphicsMagick into.
Approximately 15MB of free disk space is required to install all of
GraphicsMagick (you may choose to install a subset to save space). A
message at the bottom of the screen will tell you exactly how much
space is required to install the complete package. The default
installation directory is similar to <span class="docutils literal"><span class="pre">C:\Program</span> <span class="pre">Files\GraphicsMagick-1.3-Q8</span></span>. Once you have entered the desired
installation directory, then select "<em>Next></em>" to continue.</p>
</blockquote>
</div>
<div class="section" id="select-start-menu-folder">
<h2><a class="toc-backref" href="#id7">Select Start Menu Folder</a></h2>
<blockquote>
<p>Select the folder where you would like the program's shortcuts to
appear. The default should normally be satisfactory. Click on "<em>Next></em>"
to continue.</p>
</blockquote>
</div>
<div class="section" id="select-additional-tasks">
<h2><a class="toc-backref" href="#id8">Select Additional Tasks</a></h2>
<blockquote>
<p>A screen is displayed which presents some (or all) of the following
options:</p>
<ul class="simple">
<li><p>Create a desktop icon</p></li>
<li><p>Update executable search path</p></li>
<li><p>Associate supported file extensions with GraphicsMagick</p></li>
</ul>
<p>"Creating a desktop icon" and "Update the executable search path"
are selected by default. The remaining options default to
un-selected. Select the options you prefer.</p>
<p>Think twice before selecting "<em>Associate supported file extensions
with GraphicsMagick</em>" since this will set up approximately fifty
file associations, including common formats like JPEG, GIF, PNG,
TIFF, and PDF. These file associations will be to the 'gmdisplay'
program which is suitable for displaying images, but currently
offers little more than that. Associations for GraphicsMagick's
native formats (such as <a class="reference external" href="miff.html">MIFF</a>) will always be made.</p>
<p>Once you have made your selections, click on "<em>Next></em>" to continue.</p>
</blockquote>
</div>
<div class="section" id="ready-to-install">
<h2><a class="toc-backref" href="#id9">Ready to Install</a></h2>
<blockquote>
<p>A screen is displayed which displays the selected options. If you are
not satisfied with a selected option, then click on "<em><Back</em>" to go back
to a previous screen so that the option may be adjusted. If you are
satisfied with the options and are ready to install, then select
"<em>Install</em>". To abort the installation entirely, select "<em>Cancel</em>".</p>
</blockquote>
</div>
<div class="section" id="installation-progress">
<h2><a class="toc-backref" href="#id10">Installation Progress</a></h2>
<blockquote>
<p>While the install program is performing the installation, it will
display what it is doing in an installation progress window.</p>
</blockquote>
</div>
<div class="section" id="final-information">
<h2><a class="toc-backref" href="#id11">Final Information</a></h2>
<blockquote>
<p>A summary of post-install steps is provided. These steps include some
commands you can execute to make sure that GraphicsMagick is working,
as well as some notes about what has been installed on your system, and
where to find additional information. Once you have read this
information, click on "<em>Next></em>" to continue.</p>
</blockquote>
</div>
<div class="section" id="finishing-up">
<h2><a class="toc-backref" href="#id12">Finishing Up</a></h2>
<blockquote>
<p>By default "<em>View GraphicsMagick.html</em>" is check-marked. This causes the
GraphicsMagick web pages to be displayed in your web browser when
"<em>Finish</em>" is selected. If you do not want to view the web pages, then
de-select "<em>View GraphicsMagick.html</em>". Select "<em>Finish</em>" to exit the
installation program.</p>
</blockquote>
</div>
<div class="section" id="testing-the-installation">
<h2><a class="toc-backref" href="#id13">Testing The Installation</a></h2>
<blockquote>
<p>Select "<em>Command Prompt</em>" from the Windows Start menu. Within the window
type</p>
<blockquote>
<pre class="literal-block">gm convert logo: logo.miff
gm convert logo.miff win:</pre>
</blockquote>
<p>and the GraphicsMagick logo should be displayed in a window.</p>
</blockquote>
</div>
<div class="section" id="uninstall">
<h2><a class="toc-backref" href="#id14">Uninstall</a></h2>
<blockquote>
<p>The GraphicsMagick package incorporates its own uninstall
functionality. Always remove an installed GraphicsMagick via its
uninstall function since manually removing it (such as by removing its
installation directory) will leave behind the registry entries and path
settings established at install time.</p>
<p>GraphicsMagick should be removed via the "<em>Add or Remove Programs</em>"
area of the Windows Control Panel. Select the GraphicsMagick package
from the list, and click on "<em>Change/Remove</em>" to uninstall it.</p>
</blockquote>
</div>
<div class="section" id="use-from-another-package-or-program">
<h2><a class="toc-backref" href="#id15">Use From Another Package or Program</a></h2>
<blockquote>
<p>The GraphicsMagick gm utility may be executed as a sub-process by
other programs. If gm utility is not in the systems executable
search path (it should be since the GraphicsMagick install extends
the path by default), then the utility should be executed via the
complete path to the executable.</p>
<p>The <a class="reference external" href="ImageMagickObject.html">ImageMagickObject</a> COM object may be
used to execute the gm sub-functions (e.g. "convert") without
spawning a new process or causing Windows to pop up a window. The
COM object supports multi-threaded concurrent use. Note that the
COM object (and other components depending on proprietary libraries)
is no longer included in the installation packages we create. If
you need this, then you will need to build GraphicsMagick from
source code.</p>
<p>When GraphicsMagick is installed, entries are added to the Windows
Registry so that other programs may obtain information regarding the
most recently installed GraphicsMagick. These entries are available
under the registry path <span class="docutils literal">HKEY_LOCAL_MACHINE\SOFTWARE\GraphicsMagick\Current</span>.</p>
<p>These registry keys are currently available:</p>
<table>
<colgroup>
<col style="width: 25%" />
<col style="width: 12%" />
<col style="width: 64%" />
</colgroup>
<thead>
<tr><th class="head"><p>Key Name</p></th>
<th class="head"><p>Key Type</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr><td><p>BinPath</p></td>
<td><p>REG_SZ</p></td>
<td><p>Directory where GraphicsMagick executables
are installed</p></td>
</tr>
<tr><td><p>ConfigurePath</p></td>
<td><p>REG_SZ</p></td>
<td><p>Directory where configuration files are
installed</p></td>
</tr>
<tr><td><p>LibPath</p></td>
<td><p>REG_SZ</p></td>
<td><p>Directory where GraphicsMagick core DLLs
are installed</p></td>
</tr>
<tr><td><p>CoderModulesPath</p></td>
<td><p>REG_SZ</p></td>
<td><p>Directory where GraphicsMagick loadable
coder modules are installed</p></td>
</tr>
<tr><td><p>FilterModulesPath</p></td>
<td><p>REG_SZ</p></td>
<td><p>Directory where GraphicsMagick loadable
filter modules are installed</p></td>
</tr>
<tr><td><p>SharePath</p></td>
<td><p>REG_SZ</p></td>
<td><p>Directory where configuration files are
installed</p></td>
</tr>
</tbody>
</table>
</blockquote>
</div>
</div>
<div class="section" id="installing-from-source-code">
<h1><a class="toc-backref" href="#id16">Installing From Source Code</a></h1>
<div class="section" id="applicability">
<h2><a class="toc-backref" href="#id17">Applicability</a></h2>
<blockquote>
<p>This section provides instructions for building GraphicsMagick
Microsoft Windows using the Visual C++ (Visual Studio, etc.)
IDE. For building using the free Cygwin or MinGW compilers (e.g. as
part of <a class="reference external" href="https://www.msys2.org/">MSYS2</a>), follow the instructions
in INSTALL-unix.txt.</p>
</blockquote>
</div>
<div class="section" id="important-notes">
<h2><a class="toc-backref" href="#id18">Important Notes</a></h2>
<blockquote>
<p>On some platforms Visual C++ may fail with an internal compiler
error. If this happens to you, then make sure that your compiler is
updated with the latest fixes from the Microsoft web site and the
problem will hopefully go away. If the problem does not go away,
then adjust the settings for the module which failed and disable
optimization, and the problem is likely to go away (but with less
performance).</p>
</blockquote>
</div>
<div class="section" id="windows-xp-vista-7-visual-c-6-0-through-17-6-5-compilation">
<h2><a class="toc-backref" href="#id19">Windows XP, Vista, 7 Visual C++ 6.0 through 17.6.5 Compilation</a></h2>
<blockquote>
<p>The Visual C++ distribution targeted at Windows 2000 through Windows
10 does not provide any stock workspace (DSW) or project files (DSP)
except for those included with third party libraries. Instead, there
is a "configure" program that must run to create build
environments to satisfy various requirements.</p>
<p>The configure program resides in <span class="docutils literal">VisualMagick\configure</span> in the
GraphicsMagick source tree. A pre-compiled configure.exe is
provided, as well as Visual Studio project files to recompile it
from source code if needed.</p>
<p>Once started, the configure program provides this configuration
dialog after proceeding past the initial notifications screen:</p>
<img alt="Configure program screen shot" class="align-center" src="configure-target-setup.png" style="width: 498.0px; height: 473.0px;" />
<p>In addition to (or as a replacement to) the above dialog, the
configure.exe program supports these command-line options:</p>
<dl class="simple">
<dt><cite>/Q8 /Q16 /Q32</cite></dt>
<dd><p>Set quantum depth</p>
</dd>
<dt><cite>/x64</cite></dt>
<dd><p>Add x64 configuration</p>
</dd>
<dt><cite>/mtd /sts /mts /mtsd</cite></dt>
<dd><p>Set project type</p>
</dd>
<dt><cite>/noWizard</cite></dt>
<dd><p>Do not show the wizard</p>
</dd>
<dt><cite>/openMP</cite></dt>
<dd><p>Enable openMP</p>
</dd>
</dl>
<p>The Visual C++ system provides three different types of "runtimes"
that must match across all application, library, and DLL code that is
built. The "configure" program creates a set of build files that are
consistent for a specific runtime selection.</p>
<p>The three options for runtime support are:</p>
<ol class="arabic simple">
<li><p>Dynamic Multi-threaded DLL runtimes (VisualDynamicMT), <cite>/mtd</cite> option</p></li>
<li><p>Static Single-threaded runtimes (<cite>VisualStaticST</cite>), <cite>/sts</cite> option</p></li>
<li><p>Static Multi-threaded runtimes (VisualStaticMT), <cite>/mts</cite> option</p></li>
<li><p>Static Multi-threaded DLL runtimes (VisualStaticMTDLL), <cite>/mtsd</cite> option</p></li>
</ol>
<p>In addition to these runtimes, the VisualMagick build environment allows
you to select whether to include the X11 libraries in the build or not.
X11 DLLs and headers are provided with the VisualMagick build
environment. Most Windows users do not use X11 so they will prefer to
build without X11 support. When X11 is not supported, gm subcommands
'animate', 'display', and 'import' will not work.</p>
<p>This leads to five different possible build options, which should
cover almost any particular situation. The default binary
distribution is built using #1 from above with the X11 libraries
excluded. This results build using all DLL's for everything and
multi-threaded support (the only option for DLL's).</p>
<p>To do a build for your requirements, simply go to the configure sub-
directory under VisualMagick and open the configure.dsw workspace
(for Visual C++ 6.0) or configure.sln (for Visual C++ 7.X through
9.X). Set the build configuration to "Release" under the</p>
<blockquote>
<p>"Build..., Set Active Configuration..." menu.</p>
</blockquote>
<p>Build and execute the configure program and follow the on-screen
instructions. You should not change any of the defaults unless you have a
specific reason to do so.</p>
<p>The configure program provides a button entitled</p>
<blockquote>
<p>Edit "magick_config.h"</p>
</blockquote>
<p>Clicking this button brings up magick_config.h in Windows notepad
for optionally changing any preprocessor defines in GraphicsMagick's
magick_config.h file. This file is copied to
<span class="docutils literal">magick\magick_config.h</span>. You may safely open
<span class="docutils literal">magick\magick_config.h</span>, modify it, and recompile without
re-running the configure program. In fact, using Visual Studio to
edit the copied file may be preferable since it preserves the
original magick_config.h file.</p>
<p>Key user tunables in magick_config.h include:</p>
<blockquote>
<p>QuantumDepth (default 8)</p>
<blockquote>
<p>Specify size of PixelPacket color Quantums (8, 16, or 32) A value of
8 uses half the memory than 16 and may run 30% faster, but provides
256 times less color resolution than a value of 16.</p>
</blockquote>
<p>UseInstalledMagick (default undefined)</p>
<blockquote>
<p>Define to build a GraphicsMagick which uses registry settings or
embedded paths to locate installed components (coder modules and
configuration files). The default is to look for all files in the
same directory as the executable.</p>
</blockquote>
<p>ProvideDllMain (default undefined)</p>
<blockquote>
<p>Define to include a DllMain() function ensures that the GraphicsMagick
DLL is properly initialized without participation from dependent
applications. This avoids the requirement to invoke IntializeMagick()
from dependent applications but only works for DLL builds.</p>
</blockquote>
<p>EnableBrokenCoders (default undefined)</p>
<blockquote>
<p>Define to enable broken/dangerous file format support. Only
enable this if you have complete control over the input files
and not for arbitrary files such as uploaded from untrusted
sources via the Internet. Currently this must be enabled to
enable Adobe Photoshop Format (PSD).</p>
</blockquote>
</blockquote>
<p>After creating your build environment you can proceed to open the DSW (or
SLN) file that was generated in the VisualMagick directory and build
everything from there.</p>
<p>In the final DSW file you will find a project call "All". In order to
build everything in the distribution, select this project and make it
the "active" project. Set the build configuration to the desired one
(Debug, or Release) and do a "clean" followed by a "build". You should
do the build in a specific way:</p>
<blockquote>
<ol class="arabic simple">
<li><p>Make the "All" project the active project (Bold)
Right click on the All project and select "Set As Active Project"</p></li>
<li><p>Select "Build..., Clean"</p></li>
<li><p>Select "Build..., Build"</p></li>
<li><p>Go get some coffee unless you have a very fast machine!.</p></li>
</ol>
</blockquote>
<p>The "Clean" step is needed in order to make sure that all of the target
support libraries are updated with any patches needed to get them to
compile properly under Visual C++.</p>
<p>All of the required files that are needed to run any of the command
line tools will be found in the "bin" subdirectory of the VisualMagick
subdirectory. This includes EXE, and DLL files. You should be able
to test the build directly from this directory without having to move
anything to any of the global SYSTEM or SYSTEM32 areas in the operating
system installation.</p>
<p>Note #1:</p>
<p>The Visual C++ distribution of GraphicsMagick comes with the Magick++
C++ wrapper by default. This add-on layer has a large number of demo
and test files that can be found in <span class="docutils literal"><span class="pre">GraphicsMagick\Magick++\demo</span></span>, and
<span class="docutils literal"><span class="pre">GraphicsMagick\Magick++\tests</span></span>. There are also a variety of tests that
use the straight C API as well in <span class="docutils literal">GraphicsMagick\tests</span>.</p>
<p>All of these programs are NOT configured to be built in the default
workspace created by the configure program. You can cause all of these
demos and test programs to be built by checking the box in configure
that says:</p>
<blockquote>
<p>"Include all demo and test programs"</p>
</blockquote>
<p>In addition, there is another related checkbox (checked by default)
that causes all generated project files to be created standalone so
that they can be copied to other areas of you system.</p>
<p>This is the checkbox:</p>
<blockquote>
<p>"Generate all utility projects with full paths rather then relative
paths"</p>
</blockquote>
<p>WOW - that a mouthfull - eh?</p>
<p>Visual C++ uses a concept of "dependencies" that tell it what other
components need to be build when a particular project is being build. This
mechanism is also used to ensure that components link properly. In my normal
development environment, I want to be able to make changes and debug the
system as a whole, so I like and NEED to use dependencies. However, most
end users don't want to work this way.</p>
<p>Instead they really just want to build the package and then get down
to business working on their application. The solution is to make all
the utility projects (UTIL_xxxx_yy_exe.dsp) use full absolute paths
to all the things they need. This way the projects stand on their own
and can actually be copied and used as templates to get a particular
custom application compiling with little effort.</p>
<p>With this feature enabled, you should be able to nab a copy of...</p>
<blockquote>
<p><span class="docutils literal">VisualMagick\utilities\UTIL_gm_xxx_exe.dsp</span> (for C)</p>
<blockquote>
<p>-or-</p>
</blockquote>
<p><span class="docutils literal"><span class="pre">VisualMagick\Magick++\demo\UTIL_demo_xxx_exe.dsp</span></span> (for C++)</p>
</blockquote>
<p>... and pop it into notepad, modify it (carefully) to your needs and
be on your way to happy compiling and linking.</p>
<p>You can feel free to pick any of the standard utilities, tests, or
demo programs as the basis for a new program by copying the project
and the source and hacking away.</p>
<p>The choice of what to use as a starting point is very easy...</p>
<p>For straight C API command line applications use something from</p>
<blockquote>
<p><span class="docutils literal">GraphicsMagick\tests</span> or <span class="docutils literal">GraphicsMagick\utilities</span> (source code)</p>
<p><span class="docutils literal">GraphicsMagick\VisualMagick\tests</span> or <span class="docutils literal">GraphicsMagick\Visualmagick\utilities</span>
(project - DSP)</p>
</blockquote>
<p>For C++ and Magick++ command line applications use something from</p>
<blockquote>
<p><span class="docutils literal"><span class="pre">GraphicsMagick\Magick++\tests</span></span> or <span class="docutils literal"><span class="pre">GraphicsMagick\Magick++\demo</span></span> (source code)</p>
<p><span class="docutils literal"><span class="pre">GraphicsMagick\VisualMagick\Magick++\tests</span></span> or
<span class="docutils literal"><span class="pre">GraphicsMagick\VisualMagick\Magick++\demo</span></span> (project - DSP)</p>
</blockquote>
<p>For C++ and Magick++ and MFC windows applications use</p>
<blockquote>
<p><span class="docutils literal">GraphicsMagick\win2k\IMDisplay</span> (source code)</p>
<p><span class="docutils literal">GraphicsMagick\VisualMagick\win32\NtMagick</span> (project - DSP)</p>
</blockquote>
<p>Note #2:</p>
<p>The GraphicsMagick distribution is very modular. The default
configuration is there to get you rolling, but you need to make some
serious choices when you wish to change things around.</p>
<p>The default options are all targeted at having all the components in one
place (e.g. the "bin" directory of the VisualMagick build tree). These
components may be copied to another folder (such as to another computer).</p>
<p>The folder containing the executables and DLLs should contain the
following files:</p>
<blockquote>
<ol class="arabic simple">
<li><p>colors.mgk</p></li>
<li><p>delegates.mgk</p></li>
<li><p>log.mgk</p></li>
<li><p>magic.mgk</p></li>
<li><p>modules.mgk</p></li>
<li><p>type.mgk</p></li>
<li><p>type-ghostscript.mgk (if Ghostscript is used)</p></li>
</ol>
</blockquote>
<p>The "bin" folder should contains all EXE's and DLL's as well as the
very important "modules.mgk" file.</p>
<p>With this default setup, you can use any of the command line tools
and run scripts as normal. You can actually get by quite nicely this
way by doing something like <span class="docutils literal">pushd <span class="pre">e:\xxx\yyy\bin</span></span> in any scripts you
write to execute "out of" this directory.</p>
<p>By default the core of GraphicsMagick on Win32 always looks in the place
were the exe program is run from in order to find all of the files as
well as the DLL's it needs.</p>
</blockquote>
</div>
<div class="section" id="environment-variables">
<h2><a class="toc-backref" href="#id20">Environment Variables</a></h2>
<blockquote>
<p>You can use the "System" control panel to allow you to add and delete
what is in any of the environment variables. You can even have user
specific environment variables if you wish.</p>
<p>PATH</p>
<blockquote>
<p>This sets the default list of places were Windows looks for EXE's and
DLL's. Windows CMD shell seems to look in the "current" directory first
- no matter what, which may make it unnecessary to update the PATH. If
you wish to run any of utilities from another location then you must
add the path to your "bin" directory in. For instance, you might add:</p>
<blockquote>
<p><span class="docutils literal"><span class="pre">D:\Devel\GraphicsMagick\VisualMagick\bin</span></span></p>
</blockquote>
<p>to do this for the default build environment like I do.</p>
</blockquote>
<p>MAGICK_HOME</p>
<blockquote>
<p>If all you do is modify the PATH variable, the first problem you
will run into is that GraphicsMagick may not be able to find any of
its "modules. Modules are all the IM_MOD*.DLL files you see in the
distribution. There is one of these for each and every file format
that GraphicsMagick supports. This environment variable tells the system
were to look for these DLL's. The compiled in "default" is "execution
path" - which says - look in the same place that the application is
running "in". If you are running from somewhere other then "bin" -
this will no longer work and you must use this variable. If you elect
to leave the modules in the same place as the EXE's (a good idea)
then you can simply set this to the same place
as you did the PATH variable. In my case:</p>
<blockquote>
<p><span class="docutils literal"><span class="pre">D:\\GraphicsMagick\coders</span></span></p>
</blockquote>
<p>This is also the place were GraphicsMagick expects to find the
"colors.mgk", "delegates.mgk", "magic.mgk", "modules.mgk", and
"type.mgk" files.</p>
<p>One cool thing about the modules build of GraphicsMagick is that you can
now leave out file formats and lighten you load. If all you ever need
is GIF and JPEG, then simply drop all the other DLL's into the local
trash can and get on with your life.</p>
<p>WARNING: Always keep the "xc" format, since GM uses it for internal
purposes.</p>
</blockquote>
<p>ALSO. You can elect to changes these things the good old "hard-coded"
way. Two #defines are applicable.</p>
<p>defines.h has</p>
<blockquote>
<p><span class="docutils literal">#define MagickConfigurePath <span class="pre">"c:\\GraphicsMagick\\"</span></span></p>
</blockquote>
<p>To view any image in a Microsoft window, type</p>
<blockquote>
<p><span class="docutils literal">gm convert image.ext win:</span></p>
</blockquote>
<p>Make sure Ghostscript is installed, otherwise, you will be unable to
convert or view a Postscript document, and Postscript standard fonts will
not be available.</p>
<p>You may use any standard web browser (e.g. Internet Explorer) to browse
the GraphicsMagick documentation.</p>
<p>The Win2K executables will work under Windows '98 and later.</p>
</blockquote>
</div>
<div class="section" id="windows-distribution-build-procedure">
<h2><a class="toc-backref" href="#id21">Windows Distribution Build Procedure</a></h2>
<blockquote>
<p>The following are the instructions for how to build a Q:8 (or Q:16)
DLL-based distribution installer package using Visual Studio 2008
Professional. This is the same procedure used to produce the
release packages. The PerlMagick steps are skipped as of
GraphicsMagick 1.3.26):</p>
<ol class="arabic simple">
<li><p>Install prerequisite software:</p></li>
</ol>
<blockquote>
<ol class="loweralpha simple">
<li><p>Install Microsoft Visual Studio.</p></li>
<li><p>Download and install Inno Setup 6
<"<a class="reference external" href="http://www.jrsoftware.org/isinfo.php">http://www.jrsoftware.org/isinfo.php</a>">.</p></li>
<li><p>Download and install ActiveState ActivePerl (optional)
<"<a class="reference external" href="http://www.activestate.com/activeperl/downloads/">http://www.activestate.com/activeperl/downloads/</a>">.</p></li>
</ol>
</blockquote>
<ol class="arabic" start="2">
<li><p>Disable automatic indexing and virus scanning for the
GraphicsMagick source tree. In particular, "Windows Defender" in
Windows 10 (and similar software in earlier Windows releases) has
been observed to cause Visual Studio builds to fail since the
virus scanner opens built libraries and executables to inspect
whem while Visual Studio is still using them. Indexing and
scanning also cause significant slowdowns since there are many
megabytes of files to index.</p></li>
<li><p>Build <cite>GMVisualMagickconfigureconfigure.exe</cite> (if
missing/outdated)</p>
<ol class="loweralpha simple">
<li><p>Open workspace <cite>GMVisualMagickconfigureconfigure.dsp</cite> by
double-clicking from Windows Explorer.</p></li>
<li><p>Upgrade Visual Studio project (as required)</p></li>
<li><p>Select <cite>Rebuild All</cite> to build configure.exe</p></li>
<li><p>Close the project.</p></li>
</ol>
</li>
<li><p>Configure Initial GraphicsMagick Visual Studio Workspace</p>
<ol class="loweralpha simple">
<li><p>Use Windows Explorer to navigate to <cite>GMVisualMagickconfigure</cite>.</p></li>
<li><p>Double-click on <cite>configure.exe</cite> to run configure program.</p></li>
<li><p>Select desired build options: DLL build, Quantum Depth, 64-bit, OpenMP)</p></li>
<li><p>Check <cite>Build demo and test programs</cite>.</p></li>
<li><p>Finish remaining configure wizard screens to complete.</p></li>
<li><p><cite>File</cite> -> <cite>Close Workspace</cite>.</p></li>
</ol>
</li>
<li><p>Open Workspace, set build configuration, build GraphicsMagick software.</p>
<ol class="loweralpha simple">
<li><p>Open workspace <cite>GMVisualMagickconfigureconfigure.sln</cite> by
double-clicking from Windows Explorer.</p></li>
<li><p>Build -> "Set Active Configuration" -> "All - Win32 Release" -> OK</p></li>
<li><p>Optionally enable 64-bit (WIN64) compilation. "<cite>Build</cite> /
<cite>Configuration Manager...</cite> / <cite>Active Solution Platform</cite> /
<cite>New</cite> / <cite>x64</cite>".</p></li>
<li><p>Open <cite>CORE_magickmagickmagick_config.h</cite> and edit any
configuration settings you would like to change. For example,
you might change QuantumDepth to 16 for a"Q:16" build.</p></li>
<li><p>If using Visual Studio Professional Edition, and OpenMP
support is desired, then select <cite>CORE_magick</cite> in the Solution
Explorer pane and use the right mouse button menu to select
<cite>Properties</cite>. In <cite>Configuration Properties</cite> / <cite>C/C++</cite> /
<cite>Language</cite> set OpenMP support to 'yes'.</p></li>
<li><p>Select "Rebuild All"</p></li>
<li><p>Click on '!' icon to run configure program</p></li>
<li><p>Select DLL build</p></li>
<li><p>Check <cite>Build demo and test programs</cite>.</p></li>
<li><p>Click on Edit <cite>magick_config.h</cite> and verify desired settings
such as QuantumDepth. You can also defer this step to later
by opening the header file
<span class="docutils literal">CORE_magick\include\magick_config.h</span> in the Visual Studio
project.</p></li>
<li><p>Finish remaining configure wizard screens to complete.</p></li>
<li><p>File -> <cite>Close Workspace</cite></p></li>
</ol>
</li>
<li><p>Build ImageMagickObject</p>
<ol class="loweralpha simple">
<li><p>Open Visual Studio Command Shell Window for WIN32 or WIN64</p></li>
<li><p>Change to GraphicsMagick project directory <span class="docutils literal">GM</span></p></li>
<li><p><span class="docutils literal">cd GM\contrib\win32\ATL7\ImageMagickObject</span></p></li>
<li><p><span class="docutils literal">BuildImageMagickObject clean</span></p></li>
<li><p><span class="docutils literal">BuildImageMagickObject release</span></p></li>
<li><p><span class="docutils literal">cd <span class="pre">..\..\..\..</span></span></p></li>
</ol>
</li>
<li><p>Build PerlMagick extension (optional and now rarely done)</p>
<ol class="loweralpha">
<li><p>Open Visual Studio Command Shell Window for WIN32 or WIN64</p></li>
<li><p>Change to GraphicsMagick project directory <span class="docutils literal">GM</span></p></li>
<li><p><span class="docutils literal">cd GM\PerlMagick</span></p></li>
<li><p><span class="docutils literal">nmake clean</span> (only if this is a rebuild)</p></li>
<li><p><span class="docutils literal"><span class="pre">C:\Perl32\bin\perl.exe</span> Makefile.nt</span> (or Perl64)</p>
<p>Note that if multiple Perl's are installed, then it may be
necessary to specify the full path to perl.exe in order to use
the correct Perl.</p>
</li>
<li><p><span class="docutils literal">nmake release</span></p></li>
</ol>
</li>
</ol>
<p>NOTE: access to <em>nmake</em> requires that there be a path to it. Depending on
how the install of Visual Studio was done, this may not be the case.
Visual Studio provides a batch script in VC98Bin called VCVARS32.BAT
that can be used to do this manually after you open up a command prompt.</p>
<ol class="arabic simple" start="8">
<li><p>Open <cite>GMVisualMagickinstallergm-win32-Q8-dll-full.iss</cite> (or
<cite>gm-win32-Q16-dll-full.iss</cite> if QuantumDepth=16) by
double-clicking from Windows Explorer.</p>
<ol class="loweralpha simple">
<li><p><cite>File</cite> -> <cite>Compile</cite></p></li>
<li><p>Test install by clicking on green triangle</p></li>
</ol>
</li>
<li><p>Test PerlMagick (optional).</p>
<ol class="loweralpha simple">
<li><p><span class="docutils literal">cd PerlMagick</span></p></li>
<li><p><span class="docutils literal">nmake test</span> (All tests must pass!)</p></li>
</ol>
</li>
<li><p>Test file format read and write.</p></li>
</ol>
<blockquote>
<ol class="loweralpha simple">
<li><p><span class="docutils literal">cd VisualMagick\tests</span></p></li>
<li><p><span class="docutils literal">run_rwfile.bat</span> (All tests must pass!)</p></li>
<li><p><span class="docutils literal">run_rwblob.bat</span> (All tests must pass!)</p></li>
</ol>
</blockquote>
<ol class="arabic simple" start="11">
<li><p>Run Magick++ test programs.</p></li>
</ol>
<blockquote>
<ol class="loweralpha simple">
<li><p><span class="docutils literal">cd <span class="pre">Magick++/tests</span></span></p></li>
<li><p><span class="docutils literal">run_tests.bat</span> (All tests must pass!)</p></li>
</ol>
</blockquote>
<ol class="arabic simple" start="12">
<li><p>Run Magick++ demo programs.</p></li>
</ol>
<blockquote>
<ol class="loweralpha simple">
<li><p><span class="docutils literal">cd <span class="pre">Magick++/demo</span></span></p></li>
<li><p><span class="docutils literal">run_demos.bat</span></p></li>
<li><p>Use <em>gmdisplay</em> to visually inspect all output files.</p></li>
</ol>
</blockquote>
<ol class="arabic simple" start="13">
<li><p>Distribution package is available named similar to
<span class="docutils literal"><span class="pre">GM\VisualMagick\bin\GraphicsMagick-1.3-Q8-dll.exe</span></span></p></li>
</ol>
</blockquote>
</div>
</div>
</div>
<hr class="docutils">
<div class="document">
<p><a href="Copyright.html">Copyright</a> © GraphicsMagick Group 2002 - 2023<!--SPONSOR_LOGO--></p>
</div>
</div>
</body>
</html>
|