blob: d3f90748722b0e54d02c907c0b511cf1dfeb3ec8 [file] [log] [blame]
cristy149d58c2013-08-07 19:44:54 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
cristyad41c0c2012-10-31 00:49:28 +00003<head>
cristy149d58c2013-08-07 19:44:54 +00004 <meta http-equiv="content-type" content="text/html; charset=UTF-8"></meta>
5 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"></meta>
cristyba1758d2011-06-03 01:29:12 +00006 <title>ImageMagick: Porting to ImageMagick Version 7</title>
cristy149d58c2013-08-07 19:44:54 +00007 <meta http-equiv="content-language" content="en-US"></meta>
8 <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
9 <meta http-equiv="reply-to" content="magick-users@imagemagick.org"></meta>
10 <meta name="application-name" content="ImageMagick"></meta>
11 <meta name="description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition, resize, rotate, shear, distort or transform images automagically."></meta>
12 <meta name="application-url" content="http://www.imagemagick.org"></meta>
13 <meta name="generator" content="PHP"></meta>
14 <meta name="keywords" content="porting, to, imagemagick, version, 7, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"></meta>
15 <meta name="rating" content="GENERAL"></meta>
16 <meta name="robots" content="INDEX, FOLLOW"></meta>
17 <meta name="generator" content="ImageMagick Studio LLC"></meta>
18 <meta name="author" content="ImageMagick Studio LLC"></meta>
19 <meta name="revisit-after" content="2 DAYS"></meta>
20 <meta name="resource-type" content="document"></meta>
21 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"></meta>
22 <meta name="distribution" content="Global"></meta>
23 <link rel="icon" href="../images/wand.png"></link>
24 <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"></link>
25 <link rel="canonical" href="../index.html"></link>
26 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"></link>
cristy8ee7f242013-06-20 16:08:44 +000027
cristyad41c0c2012-10-31 00:49:28 +000028 <!-- Add jQuery library -->
cristy417eeb12013-07-28 18:48:22 +000029 <script type="text/javascript" src="http://localhost/ajax/libs/jquery/1.7/jquery.min.js"></script>
cristyad41c0c2012-10-31 00:49:28 +000030
cristy8ee7f242013-06-20 16:08:44 +000031 <!-- Add mousewheel plugin (this is optional) -->
32 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
cristyad41c0c2012-10-31 00:49:28 +000033
34 <!-- Add fancyBox -->
cristy149d58c2013-08-07 19:44:54 +000035 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen"></link>
cristy8ee7f242013-06-20 16:08:44 +000036 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.0.6"></script>
cristyad41c0c2012-10-31 00:49:28 +000037
cristy8ee7f242013-06-20 16:08:44 +000038 <!-- Optionally add helpers - button, thumbnail and/or media -->
cristy149d58c2013-08-07 19:44:54 +000039 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" type="text/css" media="screen"></link>
cristy8ee7f242013-06-20 16:08:44 +000040 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>
41 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.0"></script>
cristyad41c0c2012-10-31 00:49:28 +000042
cristy149d58c2013-08-07 19:44:54 +000043 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.6" type="text/css" media="screen"></link>
cristy8ee7f242013-06-20 16:08:44 +000044 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.6"></script>
45
cristyad41c0c2012-10-31 00:49:28 +000046 <script type="text/javascript">
47 $(document).ready(function() {
48 $(".fancybox").fancybox();
49 });
50 </script>
cristy8ee7f242013-06-20 16:08:44 +000051
cristyad41c0c2012-10-31 00:49:28 +000052 <!-- ImageMagick style -->
cristyad41c0c2012-10-31 00:49:28 +000053 <style type="text/css" media="all">
54 @import url("../www/magick.css");
55 </style>
56</head>
57
58<body id="www-imagemagick-org">
cristy8ee7f242013-06-20 16:08:44 +000059
cristy8ee7f242013-06-20 16:08:44 +000060
cristy8ee7f242013-06-20 16:08:44 +000061
cristyad41c0c2012-10-31 00:49:28 +000062<div class="titlebar">
63<div style="margin: 17px auto; float: left;">
64 <script type="text/javascript">
65 <!--
66 google_ad_client = "pub-3129977114552745";
67 google_ad_slot = "5439289906";
68 google_ad_width = 728;
69 google_ad_height = 90;
70 //-->
71 </script>
cristy149d58c2013-08-07 19:44:54 +000072
cristyad41c0c2012-10-31 00:49:28 +000073</div>
cristy149d58c2013-08-07 19:44:54 +000074<a href="../discourse-server">
75 <img src="../images/logo.jpg" alt="ImageMagick Logo" style="width: 123px; height: 118px; border: 0px; float: right;"></img></a>
cristyad41c0c2012-10-31 00:49:28 +000076<a href="../index.html">
cristy149d58c2013-08-07 19:44:54 +000077 <img src="../images/sprite.jpg" alt="ImageMagick Sprite" style="width: 114px; height: 118px; border: 0px; float: right;"></img></a>
cristyad41c0c2012-10-31 00:49:28 +000078</div>
79
80<div class="westbar">
81
cristyba1758d2011-06-03 01:29:12 +000082<div class="menu">
83 <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
84</div>
cristyba1758d2011-06-03 01:29:12 +000085<div class="menu">
cristy751980d2012-06-03 23:18:35 +000086 <a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
cristyba1758d2011-06-03 01:29:12 +000087</div>
88<div class="sub">
cristy751980d2012-06-03 23:18:35 +000089 <a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
cristyba1758d2011-06-03 01:29:12 +000090</div>
91<div class="sub">
cristy751980d2012-06-03 23:18:35 +000092 <a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
cristyba1758d2011-06-03 01:29:12 +000093</div>
94<div class="sub">
cristy751980d2012-06-03 23:18:35 +000095 <a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
cristyba1758d2011-06-03 01:29:12 +000096</div>
97<div class="sub">
cristy751980d2012-06-03 23:18:35 +000098 <a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
cristyba1758d2011-06-03 01:29:12 +000099</div>
cristyad41c0c2012-10-31 00:49:28 +0000100<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000101<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000102 <a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
cristyba1758d2011-06-03 01:29:12 +0000103</div>
104<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000105 <a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
cristyba1758d2011-06-03 01:29:12 +0000106</div>
107<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000108 <a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
cristyba1758d2011-06-03 01:29:12 +0000109</div>
110<div class="sub">
111 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
112</div>
113<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000114 <a title="Program Interfaces" href="api.html">Program Interfaces</a>
cristyba1758d2011-06-03 01:29:12 +0000115</div>
116<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000117 <a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
cristyba1758d2011-06-03 01:29:12 +0000118</div>
119<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000120 <a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
cristyba1758d2011-06-03 01:29:12 +0000121</div>
122<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000123 <a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
cristyba1758d2011-06-03 01:29:12 +0000124</div>
125<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000126 <a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
cristyba1758d2011-06-03 01:29:12 +0000127</div>
cristyad41c0c2012-10-31 00:49:28 +0000128<div class="sep"></div>
cristy149d58c2013-08-07 19:44:54 +0000129<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000130 <a title="Install from Source" href="install-source.html">Install from Source</a>
cristyba1758d2011-06-03 01:29:12 +0000131</div>
132<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000133 <a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
cristyba1758d2011-06-03 01:29:12 +0000134</div>
135<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000136 <a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
cristyba1758d2011-06-03 01:29:12 +0000137 </div>
138<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000139 <a title="Resources" href="resources.html">Resources</a>
cristyba1758d2011-06-03 01:29:12 +0000140</div>
141<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000142 <a title="Architecture" href="architecture.html">Architecture</a>
cristyba1758d2011-06-03 01:29:12 +0000143</div>
144<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000145 <a title="Download" href="download.html">Download</a>
cristyba1758d2011-06-03 01:29:12 +0000146</div>
cristyad41c0c2012-10-31 00:49:28 +0000147<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000148<div class="menu">
cristy8ee7f242013-06-20 16:08:44 +0000149 <a title="Search" href="search.html">Search</a>
cristyba1758d2011-06-03 01:29:12 +0000150</div>
cristyad41c0c2012-10-31 00:49:28 +0000151<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000152<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000153 <a title="Site Map" href="sitemap.html">Site Map</a>
cristyba1758d2011-06-03 01:29:12 +0000154</div>
cristy149d58c2013-08-07 19:44:54 +0000155<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000156 <a title="Site Map: Links" href="links.html">Links</a>
cristyba1758d2011-06-03 01:29:12 +0000157</div>
cristyad41c0c2012-10-31 00:49:28 +0000158<div class="sep"></div>
cristyeed6cb62012-01-28 19:38:34 +0000159<div class="menu">
cristy8ee7f242013-06-20 16:08:44 +0000160 <a title="Support ImageMagick Development" href="support.html">Support ImageMagick Development</a>
cristyba1758d2011-06-03 01:29:12 +0000161</div>
cristyad41c0c2012-10-31 00:49:28 +0000162</div>
163
164<div class="eastbar">
cristy149d58c2013-08-07 19:44:54 +0000165
166 <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="../index.html"></a></div>
cristy8ee7f242013-06-20 16:08:44 +0000167 <noscript>
168 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
cristy149d58c2013-08-07 19:44:54 +0000169 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0"></img></a>
cristy8ee7f242013-06-20 16:08:44 +0000170 </noscript>
cristy149d58c2013-08-07 19:44:54 +0000171
172
cristyad41c0c2012-10-31 00:49:28 +0000173</div>
174
175<div class="main">
176
cristyba1758d2011-06-03 01:29:12 +0000177<h1>ImageMagick Version 7 Porting Guide</h1>
178
cristy149d58c2013-08-07 19:44:54 +0000179<p class="navigation-index">[<a href="porting.html#imv7">ImageMagick Version 7</a><a href="porting.html#hdri">High Dynamic Range Imaging</a><a href="porting.html#channels">Pixel Channels</a><a href="porting.html#alpha">Alpha</a><a href="porting.html#grayscale">Grayscale</a><a href="porting.html#mask">Masks</a><a href="porting.html#core">MagickCore API</a><a href="porting.html#headers">Header Files</a><a href="porting.html#deprecate">Deprecated Features Removed</a><a href="porting.html#cli">Command-line Interface</a><a href="porting.html#summary">Version 7 Change Summary</a> ]</p>
cristyba1758d2011-06-03 01:29:12 +0000180
cristyeed6cb62012-01-28 19:38:34 +0000181<h2><a id="imv7"></a>ImageMagick Version 7</h2>
182<div class="doc-section">
cristy1efc1ab2011-08-01 14:47:02 +0000183<p>The design of ImageMagick is an evolutionary process, with the design and implementation efforts serving to influence and guide further progress in the other. With ImageMagick version 7 we aim to improve the design based on lessons learned from the version 6 implementation. ImageMagick was originally designed to display RGB images to an X Windows server. Over time we extended support to RGBA images and then to the CMYK and CMYKA image format. With ImageMagick version 7, we extend support to arbitrary colorspaces with an arbitrary number of pixel channels. Other design changes are in the works and we will document them here so be sure to revisit periodically.</p>
cristy29c5c992011-06-25 13:58:49 +0000184
cristyeed6cb62012-01-28 19:38:34 +0000185<p>To support variable pixel channels in the MagickCore API, pixel handling has changed when getting or setting the pixel channels. You can access channels as an array, <em>pixel[i]</em>, or use an accessor such as GetPixelRed() or SetPixelRed(). There are some modest changes to the MagickWand API. Magick++ and PerlMagick should behave exactly as it does for ImageMagick version 6.</p>
cristy29c5c992011-06-25 13:58:49 +0000186
cristy751980d2012-06-03 23:18:35 +0000187<p>The shell API (command line) of ImageMagick version 7 is also undergoing
188a major overhaul, with specific emphasis on the ability to read 'options' not
189only from the command line, but also from scripts, and file streams. This
190allows for the use of 'co-processing' programming techniques or performing
191image handling using 'deamon/server backends', and even multi-machine
192distributed processing.</p>
193
194<p>With shell API overhaul other improvements are being made, including:
cristy8ee7f242013-06-20 16:08:44 +0000195better reporting of which option failed, the consolidation and deprecation of
cristy751980d2012-06-03 23:18:35 +0000196options, and more global use of 'image properities' (more commonly known as
197'percent escapes' in option arguments. </p>
198
cristy149d58c2013-08-07 19:44:54 +0000199<p>ImageMagick version 7 is available now as an <a href="http://www.imagemagick.org/download/alpha/">Alpha</a> release. Look for a Beta release around mid-April 2013. An official ImageMagick version 7 release depends on how smoothly the Beta cycle progresses. During the Beta cycle, version 6 developers can attempt to port their software to version 7.</p>
cristy29c5c992011-06-25 13:58:49 +0000200
201<p>During the ImageMagick version 7 development cycle and release, we will continue to support and enhance version 6 for a minimum of 10 years.</p>
cristyba1758d2011-06-03 01:29:12 +0000202</div>
203
cristy8ee7f242013-06-20 16:08:44 +0000204<h2><a id="hdri"></a>High Dynamic Range Imaging</h2>
205<div class="doc-section">
206<p>ImageMagick version 7 enables <a href="high-dynamic-range.html">high dynamic range imaging</a> (HDRI) by default. HDRI accurately represents the wide range of intensity levels found in real scenes ranging from the brightest direct sunlight to the deepest darkest shadows. In addition, image processing results are more accurate. The disadvantage is it requires more memory and may result in slower processing times. To disable HDRI (recommended for smart phone builds such as iOS), simply add --disable-hdri to the configure script command line when building ImageMagick.</p>
207</div>
cristy149d58c2013-08-07 19:44:54 +0000208
cristy1efc1ab2011-08-01 14:47:02 +0000209<h2><a id="channels"></a>Pixel Channels</h2>
cristyba1758d2011-06-03 01:29:12 +0000210<div class="doc-section">
cristy1efc1ab2011-08-01 14:47:02 +0000211<p>A pixel is comprised of one or more color values, or <em>channels</em> (e.g. red pixel channel).</p>
212<p>Prior versions of ImageMagick (4-6), support 4 to 5 pixel channels (RGBA or CMYKA). The first 4 channels are accessed with the PixelPacket data structure. The structure includes 4 members of type Quantum (typically 16-bits) of red, green, blue, and opacity. The black channel or colormap indexes are supported by a separate method and structure, IndexPacket. As an example, here is a code snippet from ImageMagick version 6 that negates the color components (but not the alpha component) of the image pixels:</p>
cristyba1758d2011-06-03 01:29:12 +0000213
214<pre class="code">
cristy149d58c2013-08-07 19:44:54 +0000215 for (y=0; y &lt; (ssize_t) image-&gt;rows; y++)
cristyba1758d2011-06-03 01:29:12 +0000216 {
217 register IndexPacket
218 *indexes;
219
220 register PixelPacket
221 *q;
222
cristy149d58c2013-08-07 19:44:54 +0000223 q=GetCacheViewAuthenticPixels(image_view,0,y,image-&gt;columns,1,exception);
cristyba1758d2011-06-03 01:29:12 +0000224 if (q == (PixelPacket *) NULL)
225 {
226 status=MagickFalse;
227 continue;
228 }
229 indexes=GetCacheViewAuthenticIndexQueue(image_view);
cristy149d58c2013-08-07 19:44:54 +0000230 for (x=0; x &lt; (ssize_t) image-&gt;columns; x++)
cristyba1758d2011-06-03 01:29:12 +0000231 {
cristy149d58c2013-08-07 19:44:54 +0000232 if ((channel &amp; RedChannel) != 0)
233 q-&gt;red=(Quantum) QuantumRange-q-&gt;red;
234 if ((channel &amp; GreenChannel) != 0)
235 q-&gt;green=(Quantum) QuantumRange-q-&gt;green;
236 if ((channel &amp; BlueChannel) != 0)
237 q-&gt;blue=(Quantum) QuantumRange-q-&gt;blue;
238 if (((channel &amp; IndexChannel) != 0) &amp;&amp;
239 (image-&gt;colorspace == CMYKColorspace))
cristyba1758d2011-06-03 01:29:12 +0000240 indexes[x]=(IndexPacket) QuantumRange-indexes[x];
241 q++;
242 }
243 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
244 status=MagickFalse;
245 }
246</pre>
247
cristyeed6cb62012-01-28 19:38:34 +0000248<p>ImageMagick version 7 supports any number of channels from 1 to 32 (and beyond) and simplifies access with a single method that returns an array of pixel channels of type Quantum. Source code that compiles against prior versions of ImageMagick requires refactoring to work with ImageMagick version 7. We illustrate with an example. Let's naively refactor the version 6 code snippet from above so it works with the ImageMagick version 7 API:</p>
cristyba1758d2011-06-03 01:29:12 +0000249
250<pre class="code">
cristy149d58c2013-08-07 19:44:54 +0000251 for (y=0; y &lt; (ssize_t) image-&gt;rows; y++)
cristyba1758d2011-06-03 01:29:12 +0000252 {
253 register Quantum
254 *q;
255
cristy149d58c2013-08-07 19:44:54 +0000256 q=GetCacheViewAuthenticPixels(image_view,0,y,image-&gt;columns,1,exception);
cristyba1758d2011-06-03 01:29:12 +0000257 if (q == (Quantum *) NULL)
258 {
259 status=MagickFalse;
260 continue;
261 }
cristy149d58c2013-08-07 19:44:54 +0000262 for (x=0; x &lt; (ssize_t) image-&gt;columns; x++)
cristy29c5c992011-06-25 13:58:49 +0000263 {
cristy149d58c2013-08-07 19:44:54 +0000264 if ((GetPixelRedTraits(image) &amp; UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000265 SetPixelRed(image,QuantumRange-GetPixelRed(image,q),q);
cristy149d58c2013-08-07 19:44:54 +0000266 if ((GetPixelGreenTraits(image) &amp; UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000267 SetPixelGreen(image,QuantumRange-GetPixelGreen(image,q),q);
cristy149d58c2013-08-07 19:44:54 +0000268 if ((GetPixelBlueTraits(image) &amp; UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000269 SetPixelBlue(image,QuantumRange-GetPixelBlue(image,q),q);
cristy149d58c2013-08-07 19:44:54 +0000270 if ((GetPixelBlackTraits(image) &amp; UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000271 SetPixelBlack(image,QuantumRange-GetPixelBlack(image,q),q);
cristy149d58c2013-08-07 19:44:54 +0000272 if ((GetPixelAlphaTraits(image) &amp; UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000273 SetPixelAlpha(image,QuantumRange-GetPixelAlpha(image,q),q);
cristy1efc1ab2011-08-01 14:47:02 +0000274 q+=GetPixelChannels(image);
cristy29c5c992011-06-25 13:58:49 +0000275 }
276 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
277 status=MagickFalse;
278 }
279</pre>
280
cristy1efc1ab2011-08-01 14:47:02 +0000281<p>Let's do that again but take full advantage of the new variable pixel channel support:</p>
cristy29c5c992011-06-25 13:58:49 +0000282<pre class="code">
cristy149d58c2013-08-07 19:44:54 +0000283 for (y=0; y &lt; (ssize_t) image-&gt;rows; y++)
cristy29c5c992011-06-25 13:58:49 +0000284 {
285 register Quantum
286 *q;
287
cristy149d58c2013-08-07 19:44:54 +0000288 q=GetCacheViewAuthenticPixels(image_view,0,y,image-&gt;columns,1,exception);
cristy29c5c992011-06-25 13:58:49 +0000289 if (q == (Quantum *) NULL)
290 {
291 status=MagickFalse;
292 continue;
293 }
cristy149d58c2013-08-07 19:44:54 +0000294 for (x = 0; x &lt; (ssize_t) image-&gt;columns; x++)
cristy1efc1ab2011-08-01 14:47:02 +0000295 {
296 register ssize_t
297 i;
298
cristy8ee7f242013-06-20 16:08:44 +0000299 for (i = 0; i &lt; (ssize_t) GetPixelChannels(image); i++)
cristyba1758d2011-06-03 01:29:12 +0000300 {
cristy8ee7f242013-06-20 16:08:44 +0000301 PixelChannel channel = GetPixelChannelMapChannel(image,i);
302 PixelTrait traits = GetPixelChannelMapTraits(image,channel);
303 if (((traits &amp; UpdatePixelTrait) == 0) || (GetPixelMaskR(image,q) != 0))
304 continue;
cristy751980d2012-06-03 23:18:35 +0000305 q[i]=QuantumRange-q[i];
cristyba1758d2011-06-03 01:29:12 +0000306 }
cristy1efc1ab2011-08-01 14:47:02 +0000307 q+=GetPixelChannels(image);
308 }
cristyba1758d2011-06-03 01:29:12 +0000309 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
310 status=MagickFalse;
311 }
312</pre>
313
cristyeed6cb62012-01-28 19:38:34 +0000314<p>Note, how we use GetPixelChannels() to advance to the next set of pixel channels.</p>
cristye6e84152011-06-06 14:16:49 +0000315
cristy8ee7f242013-06-20 16:08:44 +0000316<p>The colormap indexes and black pixel channel (for the CMYK colorspace) are no longer stored in the index channel, previously accessed with GetAuthenticIndexQueue() and GetCacheViewAuthenticIndexQueue(). Instead they are now a pixel channel and accessed with the convenience pixel accessor methods GetPixelIndex(), SetPixelIndex(), GetPixelBlack(), and SetPixelBlack().</p>
cristy29c5c992011-06-25 13:58:49 +0000317
cristy149d58c2013-08-07 19:44:54 +0000318<h4>Pixel Accessors</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000319<p>Use accessors to get or set pixel channels:</p>
cristy87a7f072011-07-01 00:08:52 +0000320
321<pre class="text">
cristy8ee7f242013-06-20 16:08:44 +0000322 GetPixela() SetPixela()
323 GetPixelAlpha() SetPixelAlpha()
324 GetPixelb() SetPixelb()
325 GetPixelBlack() SetPixelBlack()
326 GetPixelBlue() SetPixelBlue()
327 GetPixelCb() SetPixelCb()
328 GetPixelCr() SetPixelCr()
329 GetPixelCyan() SetPixelCyan()
330 GetPixelGray() SetPixelGray()
331 GetPixelGreen() SetPixelGreen()
332 GetPixelIndex() SetPixelIndex()
333 GetPixelL() SetPixelL()
334 GetPixelMagenta() SetPixelMagenta()
335 GetPixelReadMask() SetPixelReadMask()
336 GetPixelWriteMask() SetPixelWriteMask()
337 GetPixelMetacontentExtent() SetPixelMetacontentExtent()
338 GetPixelOpacity() SetPixelOpacity()
339 GetPixelRed() SetPixelRed()
340 GetPixelYellow() SetPixelYellow()
341 GetPixelY() SetPixelY()
cristy87a7f072011-07-01 00:08:52 +0000342</pre>
343
cristy8ee7f242013-06-20 16:08:44 +0000344<p>You can find these accessors defined in the header file, <code>MagickCore/pixel-accessor.h</code></p>
cristy87a7f072011-07-01 00:08:52 +0000345
cristy149d58c2013-08-07 19:44:54 +0000346<h4>Pixel Traits</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000347<p>Each pixel channel includes one or more of these traits:</p>
cristya4dfb122011-07-07 19:01:57 +0000348<dl>
349<dt>Undefined</dt>
cristy149d58c2013-08-07 19:44:54 +0000350<dd>no traits associated with this pixel channel</dd>
cristy1efc1ab2011-08-01 14:47:02 +0000351<dt>Copy</dt>
cristy149d58c2013-08-07 19:44:54 +0000352<dd>do not update this pixel channel, just copy it</dd>
cristy1efc1ab2011-08-01 14:47:02 +0000353<dt>Update</dt>
cristy149d58c2013-08-07 19:44:54 +0000354<dd>update this pixel channel</dd>
cristya4dfb122011-07-07 19:01:57 +0000355<dt>Blend</dt>
cristy149d58c2013-08-07 19:44:54 +0000356<dd>blend this pixel channel with the alpha mask if it's enabled</dd>
cristya4dfb122011-07-07 19:01:57 +0000357</dl>
358<p>We provide these methods to set and get pixel traits:</p>
359<pre class="text">
cristy8ee7f242013-06-20 16:08:44 +0000360 GetPixelAlphaTraits() SetPixelAlphaTraits()
361 GetPixelBlackTraits() SetPixelBlackTraits()
362 GetPixelBlueTraits() SetPixelBlueTraits()
363 GetPixelCbTraits() SetPixelCbTraits()
364 GetPixelChannelTraits() SetPixelChannelTraits()
365 GetPixelCrTraits() SetPixelCrTraits()
366 GetPixelGrayTraits() SetPixelGrayTraits()
367 GetPixelGreenTraits() SetPixelGreenTraits()
368 GetPixelIndexTraits() SetPixelIndexTraits()
369 GetPixelMagentaTraits() SetPixelMagentaTraits()
370 GetPixelRedTraits() SetPixelRedTraits()
371 GetPixelYellowTraits() SetPixelYellowTraits()
372 GetPixelYTraits() SetPixelYTraits()
cristya4dfb122011-07-07 19:01:57 +0000373</pre>
cristy1efc1ab2011-08-01 14:47:02 +0000374<p>For convenience you can set the active trait for a set of pixel channels with a channel mask and these methods:</p>
cristya4dfb122011-07-07 19:01:57 +0000375<pre class="text">
cristy1efc1ab2011-08-01 14:47:02 +0000376 PopPixelChannelMap()
cristy1efc1ab2011-08-01 14:47:02 +0000377 SetPixelChannelMap()
cristyeed6cb62012-01-28 19:38:34 +0000378 SetPixelChannelMask()
cristya4dfb122011-07-07 19:01:57 +0000379</pre>
380
cristy8ee7f242013-06-20 16:08:44 +0000381<p>Previously MagickCore methods had channel analogs, for example, NegateImage() and NegateImageChannels(). The channel analog methods are no longer necessary because the pixel channel traits specify whether to act on a particular pixel channel or whether to blend with the alpha mask. For example, instead of</p>
cristya4dfb122011-07-07 19:01:57 +0000382<pre class="text">
383 NegateImageChannel(image,channel);
384</pre>
385<p>we use:</p>
386<pre class="text">
cristyeed6cb62012-01-28 19:38:34 +0000387 channel_mask=SetPixelChannelMask(image,channel);
388 NegateImage(image,exception);
389 (void) SetPixelChannelMap(image,channel_mask);
cristya4dfb122011-07-07 19:01:57 +0000390</pre>
391
cristy149d58c2013-08-07 19:44:54 +0000392<h4>Pixel User Channels</h4>
cristyeed6cb62012-01-28 19:38:34 +0000393<p>In version 7, we introduce pixel user channels. Traditionally we utilize 4 channels, red, green, blue, and alpha. For CMYK we also have a black channel. User channels are designed to contain whatever additional channel information that makes sense for your application. Some examples include extra channels in TIFF or PSD images or perhaps you require a channel with infrared information for the pixel. You can associate traits with the user channels so that they when they are acted upon by an image processing algorithm (e.g. blur) the pixels are copied, acted upon by the algorithm, or even blended with the alpha channel if that makes sense.</p>
cristy149d58c2013-08-07 19:44:54 +0000394<h4>Pixel Metacontent</h4>
cristyeed6cb62012-01-28 19:38:34 +0000395<p>In version 7, we introduce pixel metacontent. Metacontent is content about content. So rather than being the content itself, it's something that describes or is associated with the content. Here the content is a pixel. The pixel metacontent is for your exclusive use and is accessed with these MagickCore API methods:</p>
cristy87a7f072011-07-01 00:08:52 +0000396<pre class="text">
397 SetImageMetacontentExtent()
398 GetImageMetacontentExtent()
399 GetVirtualMetacontent()
400 GetAuthenticMetacontent()
401 GetCacheViewAuthenticMetacontent()
402 GetCacheViewVirtualMetacontent()
403</pre>
cristyba1758d2011-06-03 01:29:12 +0000404</div>
405
406<h2><a id="alpha"></a>Alpha</h2>
407<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000408<p>We support alpha now, previously opacity. With alpha, a value of 0 means that the pixel does not have any coverage information and is transparent; i.e. there was no color contribution from any geometry because the geometry did not overlap this pixel. A value of QuantumRange means that the pixel is opaque because the geometry completely overlapped the pixel. As a consequence, in version 7, the PixelInfo structure member alpha has replaced the previous opacity member. Another consequence is the alpha part of a sRGB value in hexadecimal notation is now reversed (e.g. #0000 is fully transparent).</p>
cristyba1758d2011-06-03 01:29:12 +0000409</div>
cristy87a7f072011-07-01 00:08:52 +0000410<h2><a id="grayscale"></a>Grayscale</h2>
411<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000412<p>Previously, grayscale images were Rec601Luminance and consumed 4 channels: red, green, blue, and alpha. With version 7, grayscale consumes only 1 channel requiring far less resources as a result.</p>
413</div>
414
415<h2><a id="mask"></a>Masks</h2>
416<div class="doc-section">
cristy149d58c2013-08-07 19:44:54 +0000417<p>Version 7 supports masks for most image operators. As an example, here are two methods to compute the statistics of any pixel selected by the image mask:</p>
cristy8ee7f242013-06-20 16:08:44 +0000418<pre class="text">
419identify -verbose -clip r statue.tif
420identify -verbose -mask r mask.png statue.tif
421</pre>
cristy87a7f072011-07-01 00:08:52 +0000422</div>
cristyba1758d2011-06-03 01:29:12 +0000423
cristy751980d2012-06-03 23:18:35 +0000424<h2><a id="core"></a>MagickCore API</h2>
cristy1efc1ab2011-08-01 14:47:02 +0000425<div class="doc-section">
cristyeed6cb62012-01-28 19:38:34 +0000426<p>Almost all image processing algorithms are now channel aware.</p>
cristy1efc1ab2011-08-01 14:47:02 +0000427<p>MagickCore, version 7, adds an ExceptionInfo argument to those methods that lacked it in version 6, e.g. NegateImage(image,MagickTrue,exception);</p>
428<p>All method channel analogs have been removed (e.g. BlurImageChannel()), they are no longer necessary, use pixel traits instead.</p>
cristyeed6cb62012-01-28 19:38:34 +0000429<p>Public and private API calls are now declared with the GCC visibility attribute. The MagickCore and MagickWand dynamic libraries now only export public struct and function declarations.</p>
430<p>The InterpolatePixelMethod enum is now PixelInterpolateMethod.</p>
431<p>The IntegerPixel storage type is removed (use LongPixel instead) and LongLongPixel is added</p>
432<p>Image signatures have changed to account for variable pixel channels.</p>
433<p>All color packet structures, PixelPacket, LongPacket, and DoublePacket, are consolidated to a single color structure, PixelInfo.</p>
434</div>
435<h2><a id="headers"></a>Header Files</h2>
436<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000437<p>Prior versions of ImageMagick (4-6) reference the ImageMagick header files as <code>magick/</code> and <code>wand/</code>. ImageMagick 7 instead uses <code>MagickCore/</code> and <code>MagickWand/</code> respectively. For example,</p>
cristyeed6cb62012-01-28 19:38:34 +0000438<pre class="code">
cristy149d58c2013-08-07 19:44:54 +0000439#include &lt;MagickCore/MagickCore.h&gt;
440#include &lt;MagickWand/MagickWand.h&gt;
cristyeed6cb62012-01-28 19:38:34 +0000441</pre>
cristy1efc1ab2011-08-01 14:47:02 +0000442</div>
cristy751980d2012-06-03 23:18:35 +0000443
cristyba1758d2011-06-03 01:29:12 +0000444<h2><a id="deprecate"></a>Deprecated Features Removed</h2>
445<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000446<p>All deprecated features from ImageMagick version 6 are removed in version 7. These include the <code>Magick-config</code> and <code>Wand-config</code> configuration utilities. Instead use:</p>
cristyba1758d2011-06-03 01:29:12 +0000447
448<pre class="code">
449 MagickCore-config
450 MagickWand-config
451</pre>
cristyeed6cb62012-01-28 19:38:34 +0000452<p>The FilterImage() method has been removed. Use ConvolveImage() instead.</p>
cristyba1758d2011-06-03 01:29:12 +0000453
cristy149d58c2013-08-07 19:44:54 +0000454<p>In addition, all deprecated <a href="http://magick.imagemagick.org/api/deprecate.html">MagickCore</a> and <a href="http://magick.imagemagick.org/api/magick-deprecate.html">MagickWand</a> methods are no longer available in version 7.</p>
cristy1efc1ab2011-08-01 14:47:02 +0000455</div>
cristy751980d2012-06-03 23:18:35 +0000456
457
458<h2><a id="cli"></a>Shell API or Command-line Interface</h2>
cristy1efc1ab2011-08-01 14:47:02 +0000459<div class="doc-section">
cristy751980d2012-06-03 23:18:35 +0000460
461<p>As mentioned the primary focus of the changes to the Shell API or Command
462Line Interface is the the abstration so that not only can 'options' be read
463from command line arguments, but also from a file (script) or from a file
464stream (interactive commands, or co-processing). </p>
465
466<p>To do this the CLI parser needed to be re-written, so as to always perform
467all options, in a strict, do-it-as-you-see it order. Previously in IMv6
468options were performed in groups (known as 'FireOptions), this awkwardness is
469now gone. However the strict order means that you can no long give operations
470before providing an image for the operations to work on. To do so will now
471produce an error. </p>
472
473<p>Error reporting is now reporting exactly which option (by argument count on
474command line, or line,column in scripts) caused the 'exception'. This is not
475complete as yet but getting better. Also not complete is 'regard-warnings'
476handling or its replacement, which will allow you to ignore reported errors
477and continue processing (as appropriate due to error) in co-processes or
478interactive usage. </p>
479
480<p>The parenthesis options used to 'push' the current image list, and image
cristy8ee7f242013-06-20 16:08:44 +0000481settings (EG: '<code>(</code>' and '<code>)</code>' ) on to a stack now has
cristy751980d2012-06-03 23:18:35 +0000482a completely seperate image settings stack. That is parenthesis 'push/pull'
cristy8ee7f242013-06-20 16:08:44 +0000483image lists, and curly braces (EG: '<code>{</code>' and '<code>}</code>' ) will
cristy751980d2012-06-03 23:18:35 +0000484'push/pull' image settings. </p>
485
486<p>Of course due to the previously reported changes to the underlying channel
487handling will result be many side effects to almost all options. Here are some
488specific </p>
489
490<p>Most algorithms update the red, green, blue, black (for CMYK), and alpha
491channels. Most operators will blend alpha the other color channels, but other
492operators (and situations) may require this blending to be disabled, and is
493currently done by removing alpha from teh active channels via
cristy8ee7f242013-06-20 16:08:44 +0000494<code>-channel</code> option. (e.g. <code>convert castle.gif -channel RGB
495-negate castle.png</code>). </p>
cristy751980d2012-06-03 23:18:35 +0000496
497<p>Reading gray-scale images will generate a image with only one channel. If
cristy8ee7f242013-06-20 16:08:44 +0000498that image is to then accept color the <code>-colorspace</code> setting needs to
cristy751980d2012-06-03 23:18:35 +0000499be applied to expand the one channel into separate RGB (or other) channels.
500</p>
501
502<h3>Command Changes</h3>
503<dl>
504<dt>magick</dt>
cristy8ee7f242013-06-20 16:08:44 +0000505<dd>The "<code>magick</code>" command is the new primary command of the Shell
506 API, replacing the old "<code>convert</code>" command. This allows you to
507 create a 'magick script' of the form "<code>#!/path/to/command/magick
508 -script</code>", or pipe options into a command "<code>magick -script
509 -</code>, as abackground process. </dd>
cristy751980d2012-06-03 23:18:35 +0000510
511<dt>magick-script</dt>
cristy8ee7f242013-06-20 16:08:44 +0000512<dd>This the same as "<code>magick</code>", (only command name is different)
513 but which has an implict "<code>-script</code>" option. This allows you to
514 use it in an "<code>env</code>" style script form. That is a magick script
515 starts with the 'she-bang' line of "<code>#!/usr/bin/env
516 magick-script</code>" allowing the script interpreter to be found anywhere
517 on the users command "<code>PATH</code>". This is required to get around
cristy751980d2012-06-03 23:18:35 +0000518 a "one argument she-bang bug" that is common on most UNIX systems
519 (including Linux, but not MacOSX).</dd>
520
521</dl>
522
cristy8ee7f242013-06-20 16:08:44 +0000523<h3>Behavorial Changes</h3>
524<p>Some options have changed in ImageMagick version 7. These include:</p>
525<dl>
526<dt>-combine</dt>
527<dd>This option now requires an argument, the image colorspace (e.g. -combine sRGB).</dd>
528</dl>
529
cristy751980d2012-06-03 23:18:35 +0000530<h3>New Options</h3>
531<p>ImageMagick version 7 supports these new options, though most are limited
cristy8ee7f242013-06-20 16:08:44 +0000532to the "<code>magick</code>" command, or to use in "<code>magick</code>"
cristy751980d2012-06-03 23:18:35 +0000533scripts.</p>
534
535<dl>
536<dt>{ ... }</dt>
537<dd>Save (and restore) the current image settings (internally known as the
538 "image_info" structure). This is automatically done with parenthesis (EG:
cristy8ee7f242013-06-20 16:08:44 +0000539 '<code>(</code>' and '<code>)</code>') is "<code>-regard-parenthesis</code>" has
cristy751980d2012-06-03 23:18:35 +0000540 been set, just as in IMv6. Caution is advised to prevent un-balanced
cristy149d58c2013-08-07 19:44:54 +0000541 braces errors.</dd>
cristy751980d2012-06-03 23:18:35 +0000542
543<dt>--</dt>
cristy8ee7f242013-06-20 16:08:44 +0000544<dd>End of options, to be used in IMv7 "<code>mogrify</code>" command to
cristy751980d2012-06-03 23:18:35 +0000545 explictally separate the operations to be applied and the images that
546 are to be processed 'in-place'. (not yet implemented). However if
cristy8ee7f242013-06-20 16:08:44 +0000547 not provided, "<code>-read</code>" can still be used to differentiate
cristy751980d2012-06-03 23:18:35 +0000548 secondary image reads (for use in things like alpha composition) from
549 the 'in-place' image being processed. </dd>
550
551<dd>In other commands (such as "magick") it is equivelent to a explict
cristy8ee7f242013-06-20 16:08:44 +0000552 "<code>-read</code>" (see below) of the next option as a image (as it was in
cristy751980d2012-06-03 23:18:35 +0000553 IMv6). </dd>
554
555<dt>-channel-fx <em class="arg">expression</em> </dt>
556<dd>
557<p>exchange, extract, or copy one or more image channels.</p>
558
cristy8ee7f242013-06-20 16:08:44 +0000559<p>The expression consists of one or more channels, either mnemonic or numeric (e.g. red or 0, green or 1, etc.), separated by certain operation symbols as follows:</p>
cristy751980d2012-06-03 23:18:35 +0000560
561<pre class="text">
562 &lt;=&gt; exchange two channels (e.g. red&lt;=&gt;blue)
563 =&gt; copy one channel to another channel (e.g. red=&gt;green)
564 = assign a constant value to a channel (e.g. red=50%)
565 , write new image with channels in the specified order (e.g. red, green)
cristy8ee7f242013-06-20 16:08:44 +0000566 ; add a new output image for the next set of channel operations (e.g. red; green; blue)
cristy149d58c2013-08-07 19:44:54 +0000567 | move to the next input image for the source of channel data (e.g. | gray=&gt;alpha)
cristy751980d2012-06-03 23:18:35 +0000568</pre>
569
570<p>For example, to create 3 grayscale images from the red, green, and blue channels of an image, use:</p>
571
572<pre class="text">
573 -channel-fx "red; green; blue"
574</pre>
575
576<p>A channel without an operation symbol implies separate (i.e, semicolon).</p>
577
cristy8ee7f242013-06-20 16:08:44 +0000578<p>Here we take an sRGB image and a grayscale image and inject the grayscale image into the alpha channel:</p>
579<pre class="text">
cristy149d58c2013-08-07 19:44:54 +0000580 convert wizard.png mask.pgm -channel-fx '| gray=&gt;alpha' wizard-alpha.png
cristy8ee7f242013-06-20 16:08:44 +0000581</pre>
582<p>Use a similar command to define a read mask:</p>
583<pre class="text">
cristy149d58c2013-08-07 19:44:54 +0000584 convert wizard.png mask.pgm -channel-fx '| gray=&gt;read-mask' wizard-mask.png
cristy8ee7f242013-06-20 16:08:44 +0000585</pre>
586
587<p>Add <code>-debug pixel</code> prior to the <code>-channel-fx</code> option to track the channel morphology.</p>
588
cristy751980d2012-06-03 23:18:35 +0000589</dd>
590
591<dt>-exit</dt>
592<dd>Stop processing at this point. No further options will be processed after
cristy8ee7f242013-06-20 16:08:44 +0000593 this option. Can be used in a script to force the "<code>magick</code>"
cristy751980d2012-06-03 23:18:35 +0000594 command to exit, without actually closing the pipeline that it is
595 processing options from. </dd>
596
cristy8ee7f242013-06-20 16:08:44 +0000597<dd>May also be used as a 'final' option on the "<code>magick</code>" command
cristy751980d2012-06-03 23:18:35 +0000598 line, instead of a implicit output image, to completely prevent any image
cristy8ee7f242013-06-20 16:08:44 +0000599 write. ASIDE: even the "<code>NULL:</code>" coder requires at least one
cristy751980d2012-06-03 23:18:35 +0000600 image, for it to 'not write'! This option does not require any images at
601 all. </dd>
602
603<dt>-read {image}</dt>
604<dd>Explicit read of an image, rather than an implicit read. This allows you
605 to read from filenames that start with an 'option' character, and which
606 otherwise could be mistaken as an option (unknown or otherwise). This will
cristy8ee7f242013-06-20 16:08:44 +0000607 eventually be used in "<code>mogrify</code>" to allow the reading of
cristy751980d2012-06-03 23:18:35 +0000608 secondary images, and allow the use of image list operations within that
609 command. </dd>
610
611<dt>-region</dt>
cristy8ee7f242013-06-20 16:08:44 +0000612<dd>not yet implemented in "<code>magick</code>". (very soon)</dd>
cristy751980d2012-06-03 23:18:35 +0000613
614<dt>-script {file}</dt>
cristy8ee7f242013-06-20 16:08:44 +0000615<dd>In "<code>magick</code>", stop the processing of command line arguments as
cristy751980d2012-06-03 23:18:35 +0000616 image operations, and read all further options from the given file or
617 pipeline.</dd>
618
619</dl>
620
621<h3>Changed Options</h3>
622<p>These options are known to have changed, in some way.</p>
623<dl>
624<dt>-negate</dt>
625<dd>currently negates all channels, including alpha if present. As such you
626 may need to use the -channel option to prevent alpha negation. </dd>
627
628<dt>-convolve</dt>
629<dd>option no longer normalizes the kernel argument (unless some type of
630 masking is involved, such as alpha blending) and accepts named kernels
cristy149d58c2013-08-07 19:44:54 +0000631 (see <a href="http://www.imagemagick.org/Usage/convolve/">IM Examples,
632 Convolve</a> ) as well as non-square <a href="http://www.imagemagick.org/Usage/morphology/#user">user defined
cristy8ee7f242013-06-20 16:08:44 +0000633 kernels</a>. Use <code>-define convolve:normalize=true</code> on the command-line to force normalization.</dd>
cristy751980d2012-06-03 23:18:35 +0000634
635</dl>
636
cristy8ee7f242013-06-20 16:08:44 +0000637<h3>Deprecated warning given, but will work (for now)</h3>
cristy751980d2012-06-03 23:18:35 +0000638<dl>
639<dt>-affine</dt>
cristy8ee7f242013-06-20 16:08:44 +0000640<dd>Replaced by <code>-draw "affine ..."</code>. (see transform)</dd>
cristy751980d2012-06-03 23:18:35 +0000641<dt>-average</dt>
cristy8ee7f242013-06-20 16:08:44 +0000642<dd>Replaced by <code>-evaluate-sequence Mean</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000643<dt>-box</dt>
cristy8ee7f242013-06-20 16:08:44 +0000644<dd>Replaced by <code>-undercolor</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000645<dt>-deconstruct</dt>
cristy8ee7f242013-06-20 16:08:44 +0000646<dd>Replaced by <code>-layers CompareAny</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000647<dt>-gaussian</dt>
cristy8ee7f242013-06-20 16:08:44 +0000648<dd>Replaced by <code>-gaussian-blur</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000649<dt>-/+map</dt>
cristy8ee7f242013-06-20 16:08:44 +0000650<dd>Replaced by <code>-/+remap</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000651<dt>-/+matte</dt>
cristy8ee7f242013-06-20 16:08:44 +0000652<dd>Replaced by <code>-alpha Set/Off</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000653<dt>-transform</dt>
cristy8ee7f242013-06-20 16:08:44 +0000654<dd>Replaced by <code>-distort Affine "..."</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000655</dl>
656
cristy8ee7f242013-06-20 16:08:44 +0000657<h3>Deprecated warning given, and ignored (for now)</h3>
cristy751980d2012-06-03 23:18:35 +0000658<p>Almost 'plus' (+) option that did not do anything has been marked as
cristy8ee7f242013-06-20 16:08:44 +0000659deprecated, and does nothing. It does not even have associated code. For
cristy751980d2012-06-03 23:18:35 +0000660example "+annotate", "+resize", "+clut", and "+draw" .</p>
661
662<dl>
663<dt>-affinity</dt>
cristy149d58c2013-08-07 19:44:54 +0000664<dd>Replaced by <code>-affinity</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000665<dt>-maximum</dt>
cristy8ee7f242013-06-20 16:08:44 +0000666<dd>Replaced by <code>-evaluate-sequence Max</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000667<dt>-median</dt>
cristy8ee7f242013-06-20 16:08:44 +0000668<dd>Replaced by <code>-evaluate-sequence Median</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000669<dt>-minimum</dt>
cristy8ee7f242013-06-20 16:08:44 +0000670<dd>Replaced by <code>-evaluate-sequence Min</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000671<dt>-recolor</dt>
cristy149d58c2013-08-07 19:44:54 +0000672<dd>Replaced by <code>-color-matrix</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000673</dl>
674
675<h3>Removed / Replaced Options ("no such option" error and abort)</h3>
676
677<dl>
678<dt>-origin</dt>
679<dd>old option, unknown meaning.</dd>
680<dt>-pen</dt>
cristy149d58c2013-08-07 19:44:54 +0000681<dd>Replaced by <code>-fill</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000682<dt>-passphrase</dt>
683<dd>old option, unknown meaning</dd>
684</dl>
cristy149d58c2013-08-07 19:44:54 +0000685</div>
cristyba1758d2011-06-03 01:29:12 +0000686<h2><a id="summary"></a>Version 7 Change Summary</h2>
687<div class="doc-section">
cristye6e84152011-06-06 14:16:49 +0000688<p>Changes from ImageMagick version 6 to version 7 are summarized here:</p>
cristy8ee7f242013-06-20 16:08:44 +0000689<h4>High Dynamic Range Imaging</h4>
690<dl>
691<li>ImageMagick version 7 enables HDRI by default. Expect more accurate image processing results with higher memory requirement and possible slower processing times.</li>
692</dl>
693<h4>Pixels</h4>
cristyba1758d2011-06-03 01:29:12 +0000694<dl>
cristy1efc1ab2011-08-01 14:47:02 +0000695<li>Pixels are no longer addressed with PixelPacket structure members (e.g. red, green, blue, opacity) but as an array of channels (e.g. pixel[PixelRedChannel]).</li>
696<li>Use convenience macros to access pixel channels (e.g. GetPixelRed(), SetPixelRed()).</li>
cristy8ee7f242013-06-20 16:08:44 +0000697<li>The black channel for the CMYK colorspace is no longer stored in the index channel, previously accessed with GetAuthenticIndexQueue() and GetCacheViewAuthenticIndexQueue(). Instead it is now a pixel channel and accessed with the convenience pixel macros GetPixelBlack() and SetPixelBlack().</li>
698<li>The index channel for colormapped images is no longer stored in the index channel, previously accessed with GetAuthenticIndexQueue() and GetCacheViewAuthenticIndexQueue(). Instead it is now a pixel channel and accessed with the convenience pixel macros GetPixelIndex() and SetPixelIndex().</li>
cristy1efc1ab2011-08-01 14:47:02 +0000699<li>Use GetPixelChannels() to advance to the next set of pixel channels.</li>
700<li>Use the <em>metacontent</em> channel to associate metacontent with each pixel.</li>
cristyeed6cb62012-01-28 19:38:34 +0000701<li>All color packet structures, PixelPacket, LongPacket, and DoublePacket, are consolidated to a single color structure, PixelInfo.</li>
cristyba1758d2011-06-03 01:29:12 +0000702</dl>
cristy8ee7f242013-06-20 16:08:44 +0000703<h4>Alpha</h4>
cristyba1758d2011-06-03 01:29:12 +0000704<dl>
705<li>We support alpha rather than opacity (0 transparent; QuantumRange opaque).</li>
cristy1efc1ab2011-08-01 14:47:02 +0000706<li>Use GetPixelAlpha() or SetPixelAlpha() to get or set the alpha pixel channel value.</li>
cristyba1758d2011-06-03 01:29:12 +0000707</dl>
cristy8ee7f242013-06-20 16:08:44 +0000708<h4>Grayscale</h4>
cristy87a7f072011-07-01 00:08:52 +0000709<dl>
cristy1efc1ab2011-08-01 14:47:02 +0000710<li>Grayscale images consume one pixel channel in ImageMagick version 7. To process RGB, set the colorspace to RGB (e.g. -colorspace rgb).</li>
711</dl>
cristy8ee7f242013-06-20 16:08:44 +0000712<h4>Distributed Pixel Cache</h4>
713<dl>
714<li><a href="distribute-pixel-cache.html">Distributed pixel cache</a>: offload intermediate pixel storage to one or more remote servers.</li>
715</dl>
716<h4>MagickCore API</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000717<dl>
cristyeed6cb62012-01-28 19:38:34 +0000718<li>Almost all image processing algorithms are now channel aware.</li>
cristy1efc1ab2011-08-01 14:47:02 +0000719<li>MagickCore, version 7, adds an ExceptionInfo argument to those methods that lacked it in version 6, e.g. NegateImage(image,MagickTrue,exception);</li>
720<li>All method channel analogs have been removed (e.g. BlurImageChannel()), they are no longer necessary, use pixel traits instead.</li>
cristyeed6cb62012-01-28 19:38:34 +0000721<li>Public and private API calls are now declared with the GCC visibility attribute. The MagickCore and MagickWand dynamic libraries now only export public struct and function declarations.</li>
722<li>The InterpolatePixelMethod enum is now PixelInterpolateMethod.</li>
723<li>To account for variable pixel channels, images may now return a different signature.</li>
cristy87a7f072011-07-01 00:08:52 +0000724</dl>
cristy8ee7f242013-06-20 16:08:44 +0000725<h4>Deprecated Methods</h4>
cristyba1758d2011-06-03 01:29:12 +0000726<dl>
cristy2dcd6822011-06-13 16:21:20 +0000727<li>All ImageMagick version 6 MagickCore and MagickWand deprecated methods are removed and no longer available in ImageMagick version 7.</li>
cristya4dfb122011-07-07 19:01:57 +0000728<li>All MagickCore channel method analogs are removed (e.g. NegateImageChannels()). For version 7, use pixel traits instead.</li>
cristy1efc1ab2011-08-01 14:47:02 +0000729<li>The FilterImage() method has been removed. Use ConvolveImage() instead.</li>
cristyba1758d2011-06-03 01:29:12 +0000730</dl>
731</div>
cristy751980d2012-06-03 23:18:35 +0000732
cristyad41c0c2012-10-31 00:49:28 +0000733</div>
734
735<div id="linkbar">
cristyac1b4322013-07-28 13:58:06 +0000736 <span id="linkbar-west"> </span>
cristy8ee7f242013-06-20 16:08:44 +0000737
cristyad41c0c2012-10-31 00:49:28 +0000738 <span id="linkbar-center">
cristy149d58c2013-08-07 19:44:54 +0000739 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
740 <a href="../discourse-server">Discourse Server</a>
741 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
cristy8ee7f242013-06-20 16:08:44 +0000742 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
cristyad41c0c2012-10-31 00:49:28 +0000743 </span>
cristyac1b4322013-07-28 13:58:06 +0000744 <span id="linkbar-east"> </span>
cristy149d58c2013-08-07 19:44:54 +0000745</div>
746<div class="footer">
747 <span id="footer-west">© 1999-2013 ImageMagick Studio LLC</span>
748 <span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
749</div>
750<div style="clear: both; margin: 0; width: 100%; "></div>
cristyad41c0c2012-10-31 00:49:28 +0000751</body>
752</html>