blob: 9b25ef9daebfd17920ff94d7c6e29f7fddc9d9e2 [file] [log] [blame]
cristyad41c0c2012-10-31 00:49:28 +00001
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html version="-//W3C//DTD XHTML 1.1//EN"
5 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
6 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7 xsi:schemaLocation="http://www.w3.org/1999/xhtml
8 http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
9<head>
10 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
cristy8ee7f242013-06-20 16:08:44 +000011 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"/>
cristyba1758d2011-06-03 01:29:12 +000012 <title>ImageMagick: Porting to ImageMagick Version 7</title>
cristy751980d2012-06-03 23:18:35 +000013 <meta http-equiv="content-language" content="en-US"/>
14 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
15 <meta http-equiv="reply-to" content="magick-users@imagemagick.org"/>
16 <meta name="application-name" content="ImageMagick"/>
cristy8ee7f242013-06-20 16:08:44 +000017 <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."/>
cristy751980d2012-06-03 23:18:35 +000018 <meta name="application-url" content="http://www.imagemagick.org"/>
19 <meta name="generator" content="PHP"/>
20 <meta name="keywords" content="porting, to, imagemagick, version, 7, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"/>
21 <meta name="rating" content="GENERAL"/>
22 <meta name="robots" content="INDEX, FOLLOW"/>
23 <meta name="generator" content="ImageMagick Studio LLC"/>
24 <meta name="author" content="ImageMagick Studio LLC"/>
25 <meta name="revisit-after" content="2 DAYS"/>
26 <meta name="resource-type" content="document"/>
cristy8ee7f242013-06-20 16:08:44 +000027 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"/>
cristy751980d2012-06-03 23:18:35 +000028 <meta name="distribution" content="Global"/>
cristyba1758d2011-06-03 01:29:12 +000029 <link rel="icon" href="../images/wand.png"/>
30 <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"/>
cristyad41c0c2012-10-31 00:49:28 +000031 <link rel="canonical" href="http://www.imagemagick.org" />
32 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
cristy8ee7f242013-06-20 16:08:44 +000033
cristyad41c0c2012-10-31 00:49:28 +000034 <!-- Add jQuery library -->
cristy8ee7f242013-06-20 16:08:44 +000035 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
cristyad41c0c2012-10-31 00:49:28 +000036
cristy8ee7f242013-06-20 16:08:44 +000037 <!-- Add mousewheel plugin (this is optional) -->
38 <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 +000039
40 <!-- Add fancyBox -->
cristy8ee7f242013-06-20 16:08:44 +000041 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen" />
42 <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 +000043
cristy8ee7f242013-06-20 16:08:44 +000044 <!-- Optionally add helpers - button, thumbnail and/or media -->
45 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" type="text/css" media="screen" />
46 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>
47 <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 +000048
cristy8ee7f242013-06-20 16:08:44 +000049 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.6" type="text/css" media="screen" />
50 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.6"></script>
51
cristyad41c0c2012-10-31 00:49:28 +000052 <script type="text/javascript">
53 $(document).ready(function() {
54 $(".fancybox").fancybox();
55 });
56 </script>
cristy8ee7f242013-06-20 16:08:44 +000057
cristyad41c0c2012-10-31 00:49:28 +000058 <!-- ImageMagick style -->
cristyad41c0c2012-10-31 00:49:28 +000059 <style type="text/css" media="all">
60 @import url("../www/magick.css");
61 </style>
62</head>
63
64<body id="www-imagemagick-org">
cristy8ee7f242013-06-20 16:08:44 +000065
66<script>
67 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
68 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
69 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
70 })(window,document,'offline-script','//127.0.0.1/analytics.js','ga');
71
72 ga('create', 'UA-40133312-1', 'imagemagick.org');
73 ga('send', 'pageview');
74</script>
75
cristyad41c0c2012-10-31 00:49:28 +000076<div class="titlebar">
77<div style="margin: 17px auto; float: left;">
78 <script type="text/javascript">
79 <!--
80 google_ad_client = "pub-3129977114552745";
81 google_ad_slot = "5439289906";
82 google_ad_width = 728;
83 google_ad_height = 90;
84 //-->
85 </script>
86 <script type="text/javascript"
cristy8ee7f242013-06-20 16:08:44 +000087 src="http://127.0.0.1/pagead/show_ads.js">
cristyad41c0c2012-10-31 00:49:28 +000088 </script>
89</div>
cristy8ee7f242013-06-20 16:08:44 +000090<a href="http://www.imagemagick.org/discourse-server/">
cristyad41c0c2012-10-31 00:49:28 +000091 <img src="../images/logo.jpg"
92 alt="ImageMagick Logo"
93 style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
94<a href="../index.html">
95 <img src="../images/sprite.jpg"
96 alt="ImageMagick Sprite"
97 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
98</div>
99
100<div class="westbar">
101
cristyba1758d2011-06-03 01:29:12 +0000102<div class="menu">
103 <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
104</div>
cristyba1758d2011-06-03 01:29:12 +0000105<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000106 <a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
cristyba1758d2011-06-03 01:29:12 +0000107</div>
108<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000109 <a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
cristyba1758d2011-06-03 01:29:12 +0000110</div>
111<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000112 <a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
cristyba1758d2011-06-03 01:29:12 +0000113</div>
114<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000115 <a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
cristyba1758d2011-06-03 01:29:12 +0000116</div>
117<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000118 <a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
cristyba1758d2011-06-03 01:29:12 +0000119</div>
cristyad41c0c2012-10-31 00:49:28 +0000120<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000121<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000122 <a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
cristyba1758d2011-06-03 01:29:12 +0000123</div>
124<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000125 <a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
cristyba1758d2011-06-03 01:29:12 +0000126</div>
127<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000128 <a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
cristyba1758d2011-06-03 01:29:12 +0000129</div>
130<div class="sub">
131 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
132</div>
133<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000134 <a title="Program Interfaces" href="api.html">Program Interfaces</a>
cristyba1758d2011-06-03 01:29:12 +0000135</div>
136<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000137 <a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
cristyba1758d2011-06-03 01:29:12 +0000138</div>
139<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000140 <a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
cristyba1758d2011-06-03 01:29:12 +0000141</div>
142<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000143 <a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
cristyba1758d2011-06-03 01:29:12 +0000144</div>
145<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000146 <a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
cristyba1758d2011-06-03 01:29:12 +0000147</div>
cristyad41c0c2012-10-31 00:49:28 +0000148<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000149<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000150 <a title="Install from Source" href="install-source.html">Install from Source</a>
cristyba1758d2011-06-03 01:29:12 +0000151</div>
152<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000153 <a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
cristyba1758d2011-06-03 01:29:12 +0000154</div>
155<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000156 <a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
cristyba1758d2011-06-03 01:29:12 +0000157 </div>
158<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000159 <a title="Resources" href="resources.html">Resources</a>
cristyba1758d2011-06-03 01:29:12 +0000160</div>
161<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000162 <a title="Architecture" href="architecture.html">Architecture</a>
cristyba1758d2011-06-03 01:29:12 +0000163</div>
164<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000165 <a title="Download" href="download.html">Download</a>
cristyba1758d2011-06-03 01:29:12 +0000166</div>
cristyad41c0c2012-10-31 00:49:28 +0000167<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000168<div class="menu">
cristy8ee7f242013-06-20 16:08:44 +0000169 <a title="Search" href="search.html">Search</a>
cristyba1758d2011-06-03 01:29:12 +0000170</div>
cristyad41c0c2012-10-31 00:49:28 +0000171<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000172<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000173 <a title="Site Map" href="sitemap.html">Site Map</a>
cristyba1758d2011-06-03 01:29:12 +0000174</div>
175<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000176 <a title="Site Map: Links" href="links.html">Links</a>
cristyba1758d2011-06-03 01:29:12 +0000177</div>
cristyad41c0c2012-10-31 00:49:28 +0000178<div class="sep"></div>
cristyeed6cb62012-01-28 19:38:34 +0000179<div class="menu">
cristy8ee7f242013-06-20 16:08:44 +0000180 <a title="Support ImageMagick Development" href="support.html">Support ImageMagick Development</a>
cristyba1758d2011-06-03 01:29:12 +0000181</div>
cristyad41c0c2012-10-31 00:49:28 +0000182</div>
183
184<div class="eastbar">
cristyad41c0c2012-10-31 00:49:28 +0000185 <script type="text/javascript">
cristy8ee7f242013-06-20 16:08:44 +0000186 /* <![CDATA[ */
cristyad41c0c2012-10-31 00:49:28 +0000187 (function() {
cristy8ee7f242013-06-20 16:08:44 +0000188 var po = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
189 po.type = 'text/javascript';
190 po.async = true;
191 po.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
192 var script = document.getElementsByTagName('offline-script')[0];
193 script.parentNode.insertBefore(po, script);
cristyad41c0c2012-10-31 00:49:28 +0000194 })();
cristy8ee7f242013-06-20 16:08:44 +0000195 /* ]]> */
cristyad41c0c2012-10-31 00:49:28 +0000196 </script>
cristy8ee7f242013-06-20 16:08:44 +0000197 <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
198 <noscript>
199 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
200 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0" /></a>
201 </noscript>
202 <div class="g-plusone" id="gplusone"></div>
203 <script type="text/javascript">
204 /* <![CDATA[ */
205 window.___gcfg = {
206 lang: 'en-US'
207 };
208
209 (function() {
210 var po = document.createElement('offline-script');
211 po.type = 'text/javascript';
212 po.async = true;
213 po.src = 'https://127.0.0.1/js/plusone.js';
214 var script = document.getElementsByTagName('offline-script')[0];
215 script.parentNode.insertBefore(po, script);
216 })();
217 var gplusone = document.getElementById("gplusone");
218 gplusone.setAttribute("data-size","medium");
219 gplusone.setAttribute("data-count","true");
220 /* ]]> */
221 </script>
cristyad41c0c2012-10-31 00:49:28 +0000222</div>
223
224<div class="main">
225
cristyba1758d2011-06-03 01:29:12 +0000226<h1>ImageMagick Version 7 Porting Guide</h1>
227
cristy8ee7f242013-06-20 16:08:44 +0000228<p class="navigation-index">[<a href="porting.html#imv7">ImageMagick Version 7</a> &bull; <a href="porting.html#hdri">High Dynamic Range Imaging</a> &bull; <a href="porting.html#channels">Pixel Channels</a> &bull; <a href="porting.html#alpha">Alpha</a> &bull; <a href="porting.html#grayscale">Grayscale</a> &bull; <a href="porting.html#mask">Masks</a> &bull; <a href="porting.html#core">MagickCore API</a> &bull; <a href="porting.html#headers">Header Files</a> &bull; <a href="porting.html#deprecate">Deprecated Features Removed</a> &bull; <a href="porting.html#cli">Command-line Interface</a> &bull; <a href="porting.html#summary">Version 7 Change Summary</a> ]</p>
cristyba1758d2011-06-03 01:29:12 +0000229
cristyeed6cb62012-01-28 19:38:34 +0000230<h2><a id="imv7"></a>ImageMagick Version 7</h2>
231<div class="doc-section">
cristy1efc1ab2011-08-01 14:47:02 +0000232<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 +0000233
cristyeed6cb62012-01-28 19:38:34 +0000234<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 +0000235
cristy751980d2012-06-03 23:18:35 +0000236<p>The shell API (command line) of ImageMagick version 7 is also undergoing
237a major overhaul, with specific emphasis on the ability to read 'options' not
238only from the command line, but also from scripts, and file streams. This
239allows for the use of 'co-processing' programming techniques or performing
240image handling using 'deamon/server backends', and even multi-machine
241distributed processing.</p>
242
243<p>With shell API overhaul other improvements are being made, including:
cristy8ee7f242013-06-20 16:08:44 +0000244better reporting of which option failed, the consolidation and deprecation of
cristy751980d2012-06-03 23:18:35 +0000245options, and more global use of 'image properities' (more commonly known as
246'percent escapes' in option arguments. </p>
247
cristy8ee7f242013-06-20 16:08:44 +0000248<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 +0000249
250<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 +0000251</div>
252
cristy8ee7f242013-06-20 16:08:44 +0000253<h2><a id="hdri"></a>High Dynamic Range Imaging</h2>
254<div class="doc-section">
255<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>
256</div>
cristy1efc1ab2011-08-01 14:47:02 +0000257<h2><a id="channels"></a>Pixel Channels</h2>
cristyba1758d2011-06-03 01:29:12 +0000258<div class="doc-section">
cristy1efc1ab2011-08-01 14:47:02 +0000259<p>A pixel is comprised of one or more color values, or <em>channels</em> (e.g. red pixel channel).</p>
260<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 +0000261
262<pre class="code">
263 for (y=0; y &lt; (ssize_t) image->rows; y++)
264 {
265 register IndexPacket
266 *indexes;
267
268 register PixelPacket
269 *q;
270
271 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
272 if (q == (PixelPacket *) NULL)
273 {
274 status=MagickFalse;
275 continue;
276 }
277 indexes=GetCacheViewAuthenticIndexQueue(image_view);
278 for (x=0; x &lt; (ssize_t) image->columns; x++)
279 {
cristya4dfb122011-07-07 19:01:57 +0000280 if ((channel & RedChannel) != 0)
cristyba1758d2011-06-03 01:29:12 +0000281 q->red=(Quantum) QuantumRange-q->red;
cristya4dfb122011-07-07 19:01:57 +0000282 if ((channel & GreenChannel) != 0)
cristyba1758d2011-06-03 01:29:12 +0000283 q->green=(Quantum) QuantumRange-q->green;
cristya4dfb122011-07-07 19:01:57 +0000284 if ((channel & BlueChannel) != 0)
cristyba1758d2011-06-03 01:29:12 +0000285 q->blue=(Quantum) QuantumRange-q->blue;
cristya4dfb122011-07-07 19:01:57 +0000286 if (((channel & IndexChannel) != 0) &&
cristyba1758d2011-06-03 01:29:12 +0000287 (image->colorspace == CMYKColorspace))
288 indexes[x]=(IndexPacket) QuantumRange-indexes[x];
289 q++;
290 }
291 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
292 status=MagickFalse;
293 }
294</pre>
295
cristyeed6cb62012-01-28 19:38:34 +0000296<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 +0000297
298<pre class="code">
299 for (y=0; y &lt; (ssize_t) image->rows; y++)
300 {
301 register Quantum
302 *q;
303
304 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
305 if (q == (Quantum *) NULL)
306 {
307 status=MagickFalse;
308 continue;
309 }
310 for (x=0; x &lt; (ssize_t) image->columns; x++)
cristy29c5c992011-06-25 13:58:49 +0000311 {
cristy1efc1ab2011-08-01 14:47:02 +0000312 if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000313 SetPixelRed(image,QuantumRange-GetPixelRed(image,q),q);
cristy1efc1ab2011-08-01 14:47:02 +0000314 if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000315 SetPixelGreen(image,QuantumRange-GetPixelGreen(image,q),q);
cristy1efc1ab2011-08-01 14:47:02 +0000316 if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000317 SetPixelBlue(image,QuantumRange-GetPixelBlue(image,q),q);
cristy1efc1ab2011-08-01 14:47:02 +0000318 if ((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000319 SetPixelBlack(image,QuantumRange-GetPixelBlack(image,q),q);
cristy1efc1ab2011-08-01 14:47:02 +0000320 if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
cristy29c5c992011-06-25 13:58:49 +0000321 SetPixelAlpha(image,QuantumRange-GetPixelAlpha(image,q),q);
cristy1efc1ab2011-08-01 14:47:02 +0000322 q+=GetPixelChannels(image);
cristy29c5c992011-06-25 13:58:49 +0000323 }
324 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
325 status=MagickFalse;
326 }
327</pre>
328
cristy1efc1ab2011-08-01 14:47:02 +0000329<p>Let's do that again but take full advantage of the new variable pixel channel support:</p>
cristy29c5c992011-06-25 13:58:49 +0000330<pre class="code">
331 for (y=0; y &lt; (ssize_t) image->rows; y++)
332 {
333 register Quantum
334 *q;
335
336 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
337 if (q == (Quantum *) NULL)
338 {
339 status=MagickFalse;
340 continue;
341 }
cristy8ee7f242013-06-20 16:08:44 +0000342 for (x = 0; x &lt; (ssize_t) image->columns; x++)
cristy1efc1ab2011-08-01 14:47:02 +0000343 {
344 register ssize_t
345 i;
346
cristy8ee7f242013-06-20 16:08:44 +0000347 for (i = 0; i &lt; (ssize_t) GetPixelChannels(image); i++)
cristyba1758d2011-06-03 01:29:12 +0000348 {
cristy8ee7f242013-06-20 16:08:44 +0000349 PixelChannel channel = GetPixelChannelMapChannel(image,i);
350 PixelTrait traits = GetPixelChannelMapTraits(image,channel);
351 if (((traits &amp; UpdatePixelTrait) == 0) || (GetPixelMaskR(image,q) != 0))
352 continue;
cristy751980d2012-06-03 23:18:35 +0000353 q[i]=QuantumRange-q[i];
cristyba1758d2011-06-03 01:29:12 +0000354 }
cristy1efc1ab2011-08-01 14:47:02 +0000355 q+=GetPixelChannels(image);
356 }
cristyba1758d2011-06-03 01:29:12 +0000357 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
358 status=MagickFalse;
359 }
360</pre>
361
cristyeed6cb62012-01-28 19:38:34 +0000362<p>Note, how we use GetPixelChannels() to advance to the next set of pixel channels.</p>
cristye6e84152011-06-06 14:16:49 +0000363
cristy8ee7f242013-06-20 16:08:44 +0000364<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 +0000365
cristy87a7f072011-07-01 00:08:52 +0000366<h4></a>Pixel Accessors</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000367<p>Use accessors to get or set pixel channels:</p>
cristy87a7f072011-07-01 00:08:52 +0000368
369<pre class="text">
cristy8ee7f242013-06-20 16:08:44 +0000370 GetPixela() SetPixela()
371 GetPixelAlpha() SetPixelAlpha()
372 GetPixelb() SetPixelb()
373 GetPixelBlack() SetPixelBlack()
374 GetPixelBlue() SetPixelBlue()
375 GetPixelCb() SetPixelCb()
376 GetPixelCr() SetPixelCr()
377 GetPixelCyan() SetPixelCyan()
378 GetPixelGray() SetPixelGray()
379 GetPixelGreen() SetPixelGreen()
380 GetPixelIndex() SetPixelIndex()
381 GetPixelL() SetPixelL()
382 GetPixelMagenta() SetPixelMagenta()
383 GetPixelReadMask() SetPixelReadMask()
384 GetPixelWriteMask() SetPixelWriteMask()
385 GetPixelMetacontentExtent() SetPixelMetacontentExtent()
386 GetPixelOpacity() SetPixelOpacity()
387 GetPixelRed() SetPixelRed()
388 GetPixelYellow() SetPixelYellow()
389 GetPixelY() SetPixelY()
cristy87a7f072011-07-01 00:08:52 +0000390</pre>
391
cristy8ee7f242013-06-20 16:08:44 +0000392<p>You can find these accessors defined in the header file, <code>MagickCore/pixel-accessor.h</code></p>
cristy87a7f072011-07-01 00:08:52 +0000393
cristya4dfb122011-07-07 19:01:57 +0000394<h4></a>Pixel Traits</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000395<p>Each pixel channel includes one or more of these traits:</p>
cristya4dfb122011-07-07 19:01:57 +0000396<dl>
397<dt>Undefined</dt>
cristy1efc1ab2011-08-01 14:47:02 +0000398<dd>no traits associated with this pixel channel<dd>
399<dt>Copy</dt>
400<dd>do not update this pixel channel, just copy it<dd>
401<dt>Update</dt>
402<dd>update this pixel channel<dd>
cristya4dfb122011-07-07 19:01:57 +0000403<dt>Blend</dt>
cristy1efc1ab2011-08-01 14:47:02 +0000404<dd>blend this pixel channel with the alpha mask if it's enabled<dd>
cristya4dfb122011-07-07 19:01:57 +0000405</dl>
406<p>We provide these methods to set and get pixel traits:</p>
407<pre class="text">
cristy8ee7f242013-06-20 16:08:44 +0000408 GetPixelAlphaTraits() SetPixelAlphaTraits()
409 GetPixelBlackTraits() SetPixelBlackTraits()
410 GetPixelBlueTraits() SetPixelBlueTraits()
411 GetPixelCbTraits() SetPixelCbTraits()
412 GetPixelChannelTraits() SetPixelChannelTraits()
413 GetPixelCrTraits() SetPixelCrTraits()
414 GetPixelGrayTraits() SetPixelGrayTraits()
415 GetPixelGreenTraits() SetPixelGreenTraits()
416 GetPixelIndexTraits() SetPixelIndexTraits()
417 GetPixelMagentaTraits() SetPixelMagentaTraits()
418 GetPixelRedTraits() SetPixelRedTraits()
419 GetPixelYellowTraits() SetPixelYellowTraits()
420 GetPixelYTraits() SetPixelYTraits()
cristya4dfb122011-07-07 19:01:57 +0000421</pre>
cristy1efc1ab2011-08-01 14:47:02 +0000422<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 +0000423<pre class="text">
cristy1efc1ab2011-08-01 14:47:02 +0000424 PopPixelChannelMap()
cristy1efc1ab2011-08-01 14:47:02 +0000425 SetPixelChannelMap()
cristyeed6cb62012-01-28 19:38:34 +0000426 SetPixelChannelMask()
cristya4dfb122011-07-07 19:01:57 +0000427</pre>
428
cristy8ee7f242013-06-20 16:08:44 +0000429<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 +0000430<pre class="text">
431 NegateImageChannel(image,channel);
432</pre>
433<p>we use:</p>
434<pre class="text">
cristyeed6cb62012-01-28 19:38:34 +0000435 channel_mask=SetPixelChannelMask(image,channel);
436 NegateImage(image,exception);
437 (void) SetPixelChannelMap(image,channel_mask);
cristya4dfb122011-07-07 19:01:57 +0000438</pre>
439
cristyeed6cb62012-01-28 19:38:34 +0000440<h4></a>Pixel User Channels</h4>
441<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>
cristy87a7f072011-07-01 00:08:52 +0000442<h4></a>Pixel Metacontent</h4>
cristyeed6cb62012-01-28 19:38:34 +0000443<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 +0000444<pre class="text">
445 SetImageMetacontentExtent()
446 GetImageMetacontentExtent()
447 GetVirtualMetacontent()
448 GetAuthenticMetacontent()
449 GetCacheViewAuthenticMetacontent()
450 GetCacheViewVirtualMetacontent()
451</pre>
cristyba1758d2011-06-03 01:29:12 +0000452</div>
453
454<h2><a id="alpha"></a>Alpha</h2>
455<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000456<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 +0000457</div>
cristy87a7f072011-07-01 00:08:52 +0000458<h2><a id="grayscale"></a>Grayscale</h2>
459<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000460<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>
461</div>
462
463<h2><a id="mask"></a>Masks</h2>
464<div class="doc-section">
465<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:</>
466<pre class="text">
467identify -verbose -clip r statue.tif
468identify -verbose -mask r mask.png statue.tif
469</pre>
cristy87a7f072011-07-01 00:08:52 +0000470</div>
cristyba1758d2011-06-03 01:29:12 +0000471
cristy751980d2012-06-03 23:18:35 +0000472<h2><a id="core"></a>MagickCore API</h2>
cristy1efc1ab2011-08-01 14:47:02 +0000473<div class="doc-section">
cristyeed6cb62012-01-28 19:38:34 +0000474<p>Almost all image processing algorithms are now channel aware.</p>
cristy1efc1ab2011-08-01 14:47:02 +0000475<p>MagickCore, version 7, adds an ExceptionInfo argument to those methods that lacked it in version 6, e.g. NegateImage(image,MagickTrue,exception);</p>
476<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 +0000477<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>
478<p>The InterpolatePixelMethod enum is now PixelInterpolateMethod.</p>
479<p>The IntegerPixel storage type is removed (use LongPixel instead) and LongLongPixel is added</p>
480<p>Image signatures have changed to account for variable pixel channels.</p>
481<p>All color packet structures, PixelPacket, LongPacket, and DoublePacket, are consolidated to a single color structure, PixelInfo.</p>
482</div>
483<h2><a id="headers"></a>Header Files</h2>
484<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000485<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 +0000486<pre class="code">
487#include &lt;MagickCore/MagickCore.h>
488#include &lt;MagickWand/MagickWand.h>
489</pre>
cristy1efc1ab2011-08-01 14:47:02 +0000490</div>
cristy751980d2012-06-03 23:18:35 +0000491
cristyba1758d2011-06-03 01:29:12 +0000492<h2><a id="deprecate"></a>Deprecated Features Removed</h2>
493<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000494<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 +0000495
496<pre class="code">
497 MagickCore-config
498 MagickWand-config
499</pre>
cristyeed6cb62012-01-28 19:38:34 +0000500<p>The FilterImage() method has been removed. Use ConvolveImage() instead.</p>
cristyba1758d2011-06-03 01:29:12 +0000501
cristy8ee7f242013-06-20 16:08:44 +0000502<p>In addition, all deprecated <a href="../api/deprecate.html">MagickCore</a> and <a href="../api/magick-deprecate.html">MagickWand</a> methods are no longer available in version 7.</p>
cristy1efc1ab2011-08-01 14:47:02 +0000503</div>
cristy751980d2012-06-03 23:18:35 +0000504
505
506<h2><a id="cli"></a>Shell API or Command-line Interface</h2>
cristy1efc1ab2011-08-01 14:47:02 +0000507<div class="doc-section">
cristy751980d2012-06-03 23:18:35 +0000508
509<p>As mentioned the primary focus of the changes to the Shell API or Command
510Line Interface is the the abstration so that not only can 'options' be read
511from command line arguments, but also from a file (script) or from a file
512stream (interactive commands, or co-processing). </p>
513
514<p>To do this the CLI parser needed to be re-written, so as to always perform
515all options, in a strict, do-it-as-you-see it order. Previously in IMv6
516options were performed in groups (known as 'FireOptions), this awkwardness is
517now gone. However the strict order means that you can no long give operations
518before providing an image for the operations to work on. To do so will now
519produce an error. </p>
520
521<p>Error reporting is now reporting exactly which option (by argument count on
522command line, or line,column in scripts) caused the 'exception'. This is not
523complete as yet but getting better. Also not complete is 'regard-warnings'
524handling or its replacement, which will allow you to ignore reported errors
525and continue processing (as appropriate due to error) in co-processes or
526interactive usage. </p>
527
528<p>The parenthesis options used to 'push' the current image list, and image
cristy8ee7f242013-06-20 16:08:44 +0000529settings (EG: '<code>(</code>' and '<code>)</code>' ) on to a stack now has
cristy751980d2012-06-03 23:18:35 +0000530a completely seperate image settings stack. That is parenthesis 'push/pull'
cristy8ee7f242013-06-20 16:08:44 +0000531image lists, and curly braces (EG: '<code>{</code>' and '<code>}</code>' ) will
cristy751980d2012-06-03 23:18:35 +0000532'push/pull' image settings. </p>
533
534<p>Of course due to the previously reported changes to the underlying channel
535handling will result be many side effects to almost all options. Here are some
536specific </p>
537
538<p>Most algorithms update the red, green, blue, black (for CMYK), and alpha
539channels. Most operators will blend alpha the other color channels, but other
540operators (and situations) may require this blending to be disabled, and is
541currently done by removing alpha from teh active channels via
cristy8ee7f242013-06-20 16:08:44 +0000542<code>-channel</code> option. (e.g. <code>convert castle.gif -channel RGB
543-negate castle.png</code>). </p>
cristy751980d2012-06-03 23:18:35 +0000544
545<p>Reading gray-scale images will generate a image with only one channel. If
cristy8ee7f242013-06-20 16:08:44 +0000546that image is to then accept color the <code>-colorspace</code> setting needs to
cristy751980d2012-06-03 23:18:35 +0000547be applied to expand the one channel into separate RGB (or other) channels.
548</p>
549
550<h3>Command Changes</h3>
551<dl>
552<dt>magick</dt>
cristy8ee7f242013-06-20 16:08:44 +0000553<dd>The "<code>magick</code>" command is the new primary command of the Shell
554 API, replacing the old "<code>convert</code>" command. This allows you to
555 create a 'magick script' of the form "<code>#!/path/to/command/magick
556 -script</code>", or pipe options into a command "<code>magick -script
557 -</code>, as abackground process. </dd>
cristy751980d2012-06-03 23:18:35 +0000558
559<dt>magick-script</dt>
cristy8ee7f242013-06-20 16:08:44 +0000560<dd>This the same as "<code>magick</code>", (only command name is different)
561 but which has an implict "<code>-script</code>" option. This allows you to
562 use it in an "<code>env</code>" style script form. That is a magick script
563 starts with the 'she-bang' line of "<code>#!/usr/bin/env
564 magick-script</code>" allowing the script interpreter to be found anywhere
565 on the users command "<code>PATH</code>". This is required to get around
cristy751980d2012-06-03 23:18:35 +0000566 a "one argument she-bang bug" that is common on most UNIX systems
567 (including Linux, but not MacOSX).</dd>
568
569</dl>
570
cristy8ee7f242013-06-20 16:08:44 +0000571<h3>Behavorial Changes</h3>
572<p>Some options have changed in ImageMagick version 7. These include:</p>
573<dl>
574<dt>-combine</dt>
575<dd>This option now requires an argument, the image colorspace (e.g. -combine sRGB).</dd>
576</dl>
577
cristy751980d2012-06-03 23:18:35 +0000578<h3>New Options</h3>
579<p>ImageMagick version 7 supports these new options, though most are limited
cristy8ee7f242013-06-20 16:08:44 +0000580to the "<code>magick</code>" command, or to use in "<code>magick</code>"
cristy751980d2012-06-03 23:18:35 +0000581scripts.</p>
582
583<dl>
584<dt>{ ... }</dt>
585<dd>Save (and restore) the current image settings (internally known as the
586 "image_info" structure). This is automatically done with parenthesis (EG:
cristy8ee7f242013-06-20 16:08:44 +0000587 '<code>(</code>' and '<code>)</code>') is "<code>-regard-parenthesis</code>" has
cristy751980d2012-06-03 23:18:35 +0000588 been set, just as in IMv6. Caution is advised to prevent un-balanced
589 braces errors.</dd> </dd>
590
591<dt>--</dt>
cristy8ee7f242013-06-20 16:08:44 +0000592<dd>End of options, to be used in IMv7 "<code>mogrify</code>" command to
cristy751980d2012-06-03 23:18:35 +0000593 explictally separate the operations to be applied and the images that
594 are to be processed 'in-place'. (not yet implemented). However if
cristy8ee7f242013-06-20 16:08:44 +0000595 not provided, "<code>-read</code>" can still be used to differentiate
cristy751980d2012-06-03 23:18:35 +0000596 secondary image reads (for use in things like alpha composition) from
597 the 'in-place' image being processed. </dd>
598
599<dd>In other commands (such as "magick") it is equivelent to a explict
cristy8ee7f242013-06-20 16:08:44 +0000600 "<code>-read</code>" (see below) of the next option as a image (as it was in
cristy751980d2012-06-03 23:18:35 +0000601 IMv6). </dd>
602
603<dt>-channel-fx <em class="arg">expression</em> </dt>
604<dd>
605<p>exchange, extract, or copy one or more image channels.</p>
606
cristy8ee7f242013-06-20 16:08:44 +0000607<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 +0000608
609<pre class="text">
610 &lt;=&gt; exchange two channels (e.g. red&lt;=&gt;blue)
611 =&gt; copy one channel to another channel (e.g. red=&gt;green)
612 = assign a constant value to a channel (e.g. red=50%)
613 , write new image with channels in the specified order (e.g. red, green)
cristy8ee7f242013-06-20 16:08:44 +0000614 ; add a new output image for the next set of channel operations (e.g. red; green; blue)
615 | move to the next input image for the source of channel data (e.g. | gray=>alpha)
cristy751980d2012-06-03 23:18:35 +0000616</pre>
617
618<p>For example, to create 3 grayscale images from the red, green, and blue channels of an image, use:</p>
619
620<pre class="text">
621 -channel-fx "red; green; blue"
622</pre>
623
624<p>A channel without an operation symbol implies separate (i.e, semicolon).</p>
625
cristy8ee7f242013-06-20 16:08:44 +0000626<p>Here we take an sRGB image and a grayscale image and inject the grayscale image into the alpha channel:</p>
627<pre class="text">
628 convert wizard.png mask.pgm -channel-fx '| gray=>alpha' wizard-alpha.png
629</pre>
630<p>Use a similar command to define a read mask:</p>
631<pre class="text">
632 convert wizard.png mask.pgm -channel-fx '| gray=>read-mask' wizard-mask.png
633</pre>
634
635<p>Add <code>-debug pixel</code> prior to the <code>-channel-fx</code> option to track the channel morphology.</p>
636
cristy751980d2012-06-03 23:18:35 +0000637</dd>
638
639<dt>-exit</dt>
640<dd>Stop processing at this point. No further options will be processed after
cristy8ee7f242013-06-20 16:08:44 +0000641 this option. Can be used in a script to force the "<code>magick</code>"
cristy751980d2012-06-03 23:18:35 +0000642 command to exit, without actually closing the pipeline that it is
643 processing options from. </dd>
644
cristy8ee7f242013-06-20 16:08:44 +0000645<dd>May also be used as a 'final' option on the "<code>magick</code>" command
cristy751980d2012-06-03 23:18:35 +0000646 line, instead of a implicit output image, to completely prevent any image
cristy8ee7f242013-06-20 16:08:44 +0000647 write. ASIDE: even the "<code>NULL:</code>" coder requires at least one
cristy751980d2012-06-03 23:18:35 +0000648 image, for it to 'not write'! This option does not require any images at
649 all. </dd>
650
651<dt>-read {image}</dt>
652<dd>Explicit read of an image, rather than an implicit read. This allows you
653 to read from filenames that start with an 'option' character, and which
654 otherwise could be mistaken as an option (unknown or otherwise). This will
cristy8ee7f242013-06-20 16:08:44 +0000655 eventually be used in "<code>mogrify</code>" to allow the reading of
cristy751980d2012-06-03 23:18:35 +0000656 secondary images, and allow the use of image list operations within that
657 command. </dd>
658
659<dt>-region</dt>
cristy8ee7f242013-06-20 16:08:44 +0000660<dd>not yet implemented in "<code>magick</code>". (very soon)</dd>
cristy751980d2012-06-03 23:18:35 +0000661
662<dt>-script {file}</dt>
cristy8ee7f242013-06-20 16:08:44 +0000663<dd>In "<code>magick</code>", stop the processing of command line arguments as
cristy751980d2012-06-03 23:18:35 +0000664 image operations, and read all further options from the given file or
665 pipeline.</dd>
666
667</dl>
668
669<h3>Changed Options</h3>
670<p>These options are known to have changed, in some way.</p>
671<dl>
672<dt>-negate</dt>
673<dd>currently negates all channels, including alpha if present. As such you
674 may need to use the -channel option to prevent alpha negation. </dd>
675
676<dt>-convolve</dt>
677<dd>option no longer normalizes the kernel argument (unless some type of
678 masking is involved, such as alpha blending) and accepts named kernels
679 (see <a href="http://www.imagemagick.org/Usage/convolve/" >IM Examples,
680 Convolve</a> ) as well as non-square <a
681 href="http://www.imagemagick.org/Usage/morphology/#user">user defined
cristy8ee7f242013-06-20 16:08:44 +0000682 kernels</a>. Use <code>-define convolve:normalize=true</code> on the command-line to force normalization.</dd>
cristy751980d2012-06-03 23:18:35 +0000683
684</dl>
685
cristy8ee7f242013-06-20 16:08:44 +0000686<h3>Deprecated warning given, but will work (for now)</h3>
cristy751980d2012-06-03 23:18:35 +0000687<dl>
688<dt>-affine</dt>
cristy8ee7f242013-06-20 16:08:44 +0000689<dd>Replaced by <code>-draw "affine ..."</code>. (see transform)</dd>
cristy751980d2012-06-03 23:18:35 +0000690<dt>-average</dt>
cristy8ee7f242013-06-20 16:08:44 +0000691<dd>Replaced by <code>-evaluate-sequence Mean</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000692<dt>-box</dt>
cristy8ee7f242013-06-20 16:08:44 +0000693<dd>Replaced by <code>-undercolor</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000694<dt>-deconstruct</dt>
cristy8ee7f242013-06-20 16:08:44 +0000695<dd>Replaced by <code>-layers CompareAny</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000696<dt>-gaussian</dt>
cristy8ee7f242013-06-20 16:08:44 +0000697<dd>Replaced by <code>-gaussian-blur</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000698<dt>-/+map</dt>
cristy8ee7f242013-06-20 16:08:44 +0000699<dd>Replaced by <code>-/+remap</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000700<dt>-/+matte</dt>
cristy8ee7f242013-06-20 16:08:44 +0000701<dd>Replaced by <code>-alpha Set/Off</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000702<dt>-transform</dt>
cristy8ee7f242013-06-20 16:08:44 +0000703<dd>Replaced by <code>-distort Affine "..."</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000704</dl>
705
cristy8ee7f242013-06-20 16:08:44 +0000706<h3>Deprecated warning given, and ignored (for now)</h3>
cristy751980d2012-06-03 23:18:35 +0000707<p>Almost 'plus' (+) option that did not do anything has been marked as
cristy8ee7f242013-06-20 16:08:44 +0000708deprecated, and does nothing. It does not even have associated code. For
cristy751980d2012-06-03 23:18:35 +0000709example "+annotate", "+resize", "+clut", and "+draw" .</p>
710
711<dl>
712<dt>-affinity</dt>
cristy8ee7f242013-06-20 16:08:44 +0000713<dd>Replaced by <dd>-affinity</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000714<dt>-maximum</dt>
cristy8ee7f242013-06-20 16:08:44 +0000715<dd>Replaced by <code>-evaluate-sequence Max</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000716<dt>-median</dt>
cristy8ee7f242013-06-20 16:08:44 +0000717<dd>Replaced by <code>-evaluate-sequence Median</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000718<dt>-minimum</dt>
cristy8ee7f242013-06-20 16:08:44 +0000719<dd>Replaced by <code>-evaluate-sequence Min</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000720<dt>-recolor</dt>
cristy8ee7f242013-06-20 16:08:44 +0000721<dd>Replaced by <dd>-color-matrix</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000722</dl>
723
724<h3>Removed / Replaced Options ("no such option" error and abort)</h3>
725
726<dl>
727<dt>-origin</dt>
728<dd>old option, unknown meaning.</dd>
729<dt>-pen</dt>
cristy8ee7f242013-06-20 16:08:44 +0000730<dd>Replaced by <dd>-fill</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000731<dt>-passphrase</dt>
732<dd>old option, unknown meaning</dd>
733</dl>
cristyba1758d2011-06-03 01:29:12 +0000734<h2><a id="summary"></a>Version 7 Change Summary</h2>
735<div class="doc-section">
cristye6e84152011-06-06 14:16:49 +0000736<p>Changes from ImageMagick version 6 to version 7 are summarized here:</p>
cristy8ee7f242013-06-20 16:08:44 +0000737<h4>High Dynamic Range Imaging</h4>
738<dl>
739<li>ImageMagick version 7 enables HDRI by default. Expect more accurate image processing results with higher memory requirement and possible slower processing times.</li>
740</dl>
741<h4>Pixels</h4>
cristyba1758d2011-06-03 01:29:12 +0000742<dl>
cristy1efc1ab2011-08-01 14:47:02 +0000743<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>
744<li>Use convenience macros to access pixel channels (e.g. GetPixelRed(), SetPixelRed()).</li>
cristy8ee7f242013-06-20 16:08:44 +0000745<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>
746<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 +0000747<li>Use GetPixelChannels() to advance to the next set of pixel channels.</li>
748<li>Use the <em>metacontent</em> channel to associate metacontent with each pixel.</li>
cristyeed6cb62012-01-28 19:38:34 +0000749<li>All color packet structures, PixelPacket, LongPacket, and DoublePacket, are consolidated to a single color structure, PixelInfo.</li>
cristyba1758d2011-06-03 01:29:12 +0000750</dl>
cristy8ee7f242013-06-20 16:08:44 +0000751<h4>Alpha</h4>
cristyba1758d2011-06-03 01:29:12 +0000752<dl>
753<li>We support alpha rather than opacity (0 transparent; QuantumRange opaque).</li>
cristy1efc1ab2011-08-01 14:47:02 +0000754<li>Use GetPixelAlpha() or SetPixelAlpha() to get or set the alpha pixel channel value.</li>
cristyba1758d2011-06-03 01:29:12 +0000755</dl>
cristy8ee7f242013-06-20 16:08:44 +0000756<h4>Grayscale</h4>
cristy87a7f072011-07-01 00:08:52 +0000757<dl>
cristy1efc1ab2011-08-01 14:47:02 +0000758<li>Grayscale images consume one pixel channel in ImageMagick version 7. To process RGB, set the colorspace to RGB (e.g. -colorspace rgb).</li>
759</dl>
cristy8ee7f242013-06-20 16:08:44 +0000760<h4>Distributed Pixel Cache</h4>
761<dl>
762<li><a href="distribute-pixel-cache.html">Distributed pixel cache</a>: offload intermediate pixel storage to one or more remote servers.</li>
763</dl>
764<h4>MagickCore API</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000765<dl>
cristyeed6cb62012-01-28 19:38:34 +0000766<li>Almost all image processing algorithms are now channel aware.</li>
cristy1efc1ab2011-08-01 14:47:02 +0000767<li>MagickCore, version 7, adds an ExceptionInfo argument to those methods that lacked it in version 6, e.g. NegateImage(image,MagickTrue,exception);</li>
768<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 +0000769<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>
770<li>The InterpolatePixelMethod enum is now PixelInterpolateMethod.</li>
771<li>To account for variable pixel channels, images may now return a different signature.</li>
cristy87a7f072011-07-01 00:08:52 +0000772</dl>
cristy8ee7f242013-06-20 16:08:44 +0000773<h4>Deprecated Methods</h4>
cristyba1758d2011-06-03 01:29:12 +0000774<dl>
cristy2dcd6822011-06-13 16:21:20 +0000775<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 +0000776<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 +0000777<li>The FilterImage() method has been removed. Use ConvolveImage() instead.</li>
cristyba1758d2011-06-03 01:29:12 +0000778</dl>
779</div>
cristy751980d2012-06-03 23:18:35 +0000780
cristyad41c0c2012-10-31 00:49:28 +0000781
782</div>
783
784<div id="linkbar">
785 <span id="linkbar-west">&nbsp;</span>
cristy8ee7f242013-06-20 16:08:44 +0000786
cristyad41c0c2012-10-31 00:49:28 +0000787 <span id="linkbar-center">
cristy8ee7f242013-06-20 16:08:44 +0000788 <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &bull;
789 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> &bull;
790 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
cristyad41c0c2012-10-31 00:49:28 +0000791 </span>
792 <span id="linkbar-east">&nbsp;</span>
793 </div>
794 <div class="footer">
cristy45ef08f2012-12-07 13:13:34 +0000795 <span id="footer-west">&copy; 1999-2013 ImageMagick Studio LLC</span>
cristyad41c0c2012-10-31 00:49:28 +0000796 <span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
797 </div>
798 <div style="clear: both; margin: 0; width: 100%; "></div>
cristyad41c0c2012-10-31 00:49:28 +0000799</body>
800</html>