blob: b74e44ff62f8e0b96dfadb417e74d35f3732b773 [file] [log] [blame]
cristy91469932014-07-25 11:00:25 +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">
cristyad41c0c2012-10-31 00:49:28 +00009<head>
cristy91469932014-07-25 11:00:25 +000010 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
11 <meta name=viewport content="width=device-width, initial-scale=0.3333334">
12 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"/>
cristyba1758d2011-06-03 01:29:12 +000013 <title>ImageMagick: Porting to ImageMagick Version 7</title>
cristy91469932014-07-25 11:00:25 +000014 <meta http-equiv="content-language" content="en-US"/>
15 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
16 <meta http-equiv="reply-to" content="magick-users@imagemagick.org"/>
17 <meta name="application-name" content="ImageMagick"/>
18 <meta name="description" content="A collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats."/>
19 <meta name="application-url" content="http://www.imagemagick.org"/>
20 <meta name="generator" content="PHP"/>
21 <meta name="keywords" content="porting, to, imagemagick, version, 7, convert, edit, compose, image, pixel"/>
22 <meta name="rating" content="GENERAL"/>
23 <meta name="robots" content="INDEX, FOLLOW"/>
24 <meta name="generator" content="ImageMagick Studio LLC"/>
25 <meta name="author" content="ImageMagick Studio LLC"/>
26 <meta name="revisit-after" content="2 DAYS"/>
27 <meta name="resource-type" content="document"/>
28 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"/>
29 <meta name="distribution" content="Global"/>
30 <link rel="icon" href="../images/wand.png"/>
31 <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"/>
32 <link rel="canonical" href="http://www.imagemagick.org" />
33 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
cristy8ee7f242013-06-20 16:08:44 +000034
cristyad41c0c2012-10-31 00:49:28 +000035 <!-- Add jQuery library -->
cristy91469932014-07-25 11:00:25 +000036 <script type="text/javascript" src="http://localhost/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
cristyad41c0c2012-10-31 00:49:28 +000037
cristy8ee7f242013-06-20 16:08:44 +000038 <!-- Add mousewheel plugin (this is optional) -->
39 <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 +000040
41 <!-- Add fancyBox -->
cristy91469932014-07-25 11:00:25 +000042 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
43 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
cristyad41c0c2012-10-31 00:49:28 +000044
cristy8ee7f242013-06-20 16:08:44 +000045 <!-- Optionally add helpers - button, thumbnail and/or media -->
cristy91469932014-07-25 11:00:25 +000046 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />
47 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
48 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
cristyad41c0c2012-10-31 00:49:28 +000049
cristy91469932014-07-25 11:00:25 +000050 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
51 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
cristy8ee7f242013-06-20 16:08:44 +000052
cristyad41c0c2012-10-31 00:49:28 +000053 <script type="text/javascript">
54 $(document).ready(function() {
55 $(".fancybox").fancybox();
56 });
57 </script>
cristy8ee7f242013-06-20 16:08:44 +000058
cristyad41c0c2012-10-31 00:49:28 +000059 <!-- ImageMagick style -->
cristyad41c0c2012-10-31 00:49:28 +000060 <style type="text/css" media="all">
61 @import url("../www/magick.css");
62 </style>
63</head>
64
65<body id="www-imagemagick-org">
cristy8ee7f242013-06-20 16:08:44 +000066
cristy91469932014-07-25 11:00:25 +000067<script type="text/javascript">
68 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
69 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
70 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
71 })(window,document,'offline-script','//www.google-analytics.com/analytics.js','ga');
cristy8ee7f242013-06-20 16:08:44 +000072
cristy91469932014-07-25 11:00:25 +000073 ga('create', 'UA-40133312-1', 'imagemagick.org');
74 ga('send', 'pageview');
75</script>
cristy8ee7f242013-06-20 16:08:44 +000076
cristyad41c0c2012-10-31 00:49:28 +000077<div class="titlebar">
78<div style="margin: 17px auto; float: left;">
79 <script type="text/javascript">
80 <!--
81 google_ad_client = "pub-3129977114552745";
82 google_ad_slot = "5439289906";
83 google_ad_width = 728;
84 google_ad_height = 90;
85 //-->
86 </script>
cristy91469932014-07-25 11:00:25 +000087 <script type="text/javascript"
88 src="http://localhost/pagead/show_ads.js">
89 </script>
cristyad41c0c2012-10-31 00:49:28 +000090</div>
cristy149d58c2013-08-07 19:44:54 +000091<a href="../discourse-server">
cristy91469932014-07-25 11:00:25 +000092 <img src="../images/logo.jpg"
93 alt="ImageMagick Logo" width="123" height="118"
94 style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
cristyf1b8a092014-02-20 15:46:11 +000095<a href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">
cristy91469932014-07-25 11:00:25 +000096 <img src="../images/sprite.jpg"
97 alt="ImageMagick Sprite" width="114" height="118"
98 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
cristyad41c0c2012-10-31 00:49:28 +000099</div>
100
101<div class="westbar">
102
cristyba1758d2011-06-03 01:29:12 +0000103<div class="menu">
cristyf1b8a092014-02-20 15:46:11 +0000104 <a title="About ImageMagick" href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">About ImageMagick</a>
cristyba1758d2011-06-03 01:29:12 +0000105</div>
cristyba1758d2011-06-03 01:29:12 +0000106<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000107 <a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
cristyba1758d2011-06-03 01:29:12 +0000108</div>
109<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000110 <a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
cristyba1758d2011-06-03 01:29:12 +0000111</div>
112<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000113 <a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
cristyba1758d2011-06-03 01:29:12 +0000114</div>
115<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000116 <a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
cristyba1758d2011-06-03 01:29:12 +0000117</div>
118<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000119 <a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
cristyba1758d2011-06-03 01:29:12 +0000120</div>
cristyad41c0c2012-10-31 00:49:28 +0000121<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000122<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000123 <a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
cristyba1758d2011-06-03 01:29:12 +0000124</div>
125<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000126 <a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
cristyba1758d2011-06-03 01:29:12 +0000127</div>
128<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000129 <a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
cristyba1758d2011-06-03 01:29:12 +0000130</div>
131<div class="sub">
132 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
133</div>
134<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000135 <a title="Program Interfaces" href="api.html">Program Interfaces</a>
cristyba1758d2011-06-03 01:29:12 +0000136</div>
137<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000138 <a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
cristyba1758d2011-06-03 01:29:12 +0000139</div>
140<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000141 <a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
cristyba1758d2011-06-03 01:29:12 +0000142</div>
143<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000144 <a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
cristyba1758d2011-06-03 01:29:12 +0000145</div>
146<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000147 <a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
cristyba1758d2011-06-03 01:29:12 +0000148</div>
cristyad41c0c2012-10-31 00:49:28 +0000149<div class="sep"></div>
cristy91469932014-07-25 11:00:25 +0000150<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000151 <a title="Install from Source" href="install-source.html">Install from Source</a>
cristyba1758d2011-06-03 01:29:12 +0000152</div>
153<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000154 <a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
cristyba1758d2011-06-03 01:29:12 +0000155</div>
156<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000157 <a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
cristyba1758d2011-06-03 01:29:12 +0000158 </div>
159<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000160 <a title="Resources" href="resources.html">Resources</a>
cristyba1758d2011-06-03 01:29:12 +0000161</div>
162<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000163 <a title="Architecture" href="architecture.html">Architecture</a>
cristyba1758d2011-06-03 01:29:12 +0000164</div>
165<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000166 <a title="Download" href="download.html">Download</a>
cristyba1758d2011-06-03 01:29:12 +0000167</div>
cristyad41c0c2012-10-31 00:49:28 +0000168<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000169<div class="menu">
cristy8ee7f242013-06-20 16:08:44 +0000170 <a title="Search" href="search.html">Search</a>
cristyba1758d2011-06-03 01:29:12 +0000171</div>
cristyad41c0c2012-10-31 00:49:28 +0000172<div class="sep"></div>
cristyba1758d2011-06-03 01:29:12 +0000173<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000174 <a title="Site Map" href="sitemap.html">Site Map</a>
cristyba1758d2011-06-03 01:29:12 +0000175</div>
cristy91469932014-07-25 11:00:25 +0000176<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000177 <a title="Site Map: Links" href="links.html">Links</a>
cristyba1758d2011-06-03 01:29:12 +0000178</div>
cristyad41c0c2012-10-31 00:49:28 +0000179<div class="sep"></div>
cristyad41c0c2012-10-31 00:49:28 +0000180</div>
181
182<div class="eastbar">
cristy91469932014-07-25 11:00:25 +0000183 <script type="text/javascript">
184 /* <![CDATA[ */
185 window.___gcfg = {
186 lang: 'en-US'
187 };
188
189 (function() {
190 var po = document.createElement('offline-script');
191 po.type = 'text/javascript';
192 po.async = true;
193 po.src = 'https://apis.google.com/js/plusone.js';
194 var script = document.getElementsByTagName('offline-script')[0];
195 script.parentNode.insertBefore(po, script);
196 })();
197 var gplusone = document.getElementById("gplusone");
198 gplusone.setAttribute("data-size","medium");
199 gplusone.setAttribute("data-count","true");
200 /* ]]> */
201 </script>
202 <script type="text/javascript">
203 /* <![CDATA[ */
204 (function() {
205 var po = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
206 po.type = 'text/javascript';
207 po.async = true;
208 po.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
209 var script = document.getElementsByTagName('offline-script')[0];
210 script.parentNode.insertBefore(po, script);
211 })();
212 /* ]]> */
213 </script>
cristyf1b8a092014-02-20 15:46:11 +0000214 <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
cristy8ee7f242013-06-20 16:08:44 +0000215 <noscript>
216 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
cristy91469932014-07-25 11:00:25 +0000217 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0" /></a>
cristy8ee7f242013-06-20 16:08:44 +0000218 </noscript>
cristy91469932014-07-25 11:00:25 +0000219 <div class="g-plusone" data-size="standard" data-count="true"></div>
cristyad41c0c2012-10-31 00:49:28 +0000220</div>
221
222<div class="main">
223
cristyba1758d2011-06-03 01:29:12 +0000224<h1>ImageMagick Version 7 Porting Guide</h1>
225
cristy149d58c2013-08-07 19:44:54 +0000226<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 +0000227
cristyeed6cb62012-01-28 19:38:34 +0000228<h2><a id="imv7"></a>ImageMagick Version 7</h2>
229<div class="doc-section">
cristy1efc1ab2011-08-01 14:47:02 +0000230<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 +0000231
cristyeed6cb62012-01-28 19:38:34 +0000232<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 +0000233
cristy751980d2012-06-03 23:18:35 +0000234<p>The shell API (command line) of ImageMagick version 7 is also undergoing
235a major overhaul, with specific emphasis on the ability to read 'options' not
236only from the command line, but also from scripts, and file streams. This
237allows for the use of 'co-processing' programming techniques or performing
238image handling using 'deamon/server backends', and even multi-machine
239distributed processing.</p>
240
241<p>With shell API overhaul other improvements are being made, including:
cristy8ee7f242013-06-20 16:08:44 +0000242better reporting of which option failed, the consolidation and deprecation of
cristy751980d2012-06-03 23:18:35 +0000243options, and more global use of 'image properities' (more commonly known as
244'percent escapes' in option arguments. </p>
245
cristy91469932014-07-25 11:00:25 +0000246<p>ImageMagick version 7 is available now as an <a href="http://www.imagemagick.org/download/beta/">Beta</a> release. Look for an official release around 1st Q 2016. 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 +0000247
cristy91469932014-07-25 11:00:25 +0000248<p>Once ImageMagick version 7 is released, we will continue to support and enhance version 6 for a minimum of 10 years.</p>
cristyba1758d2011-06-03 01:29:12 +0000249</div>
250
cristy8ee7f242013-06-20 16:08:44 +0000251<h2><a id="hdri"></a>High Dynamic Range Imaging</h2>
252<div class="doc-section">
cristy91469932014-07-25 11:00:25 +0000253<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 <code>--disable-hdri</code> to the configure script command line when building ImageMagick.</p>
cristy8ee7f242013-06-20 16:08:44 +0000254</div>
cristy149d58c2013-08-07 19:44:54 +0000255
cristy1efc1ab2011-08-01 14:47:02 +0000256<h2><a id="channels"></a>Pixel Channels</h2>
cristyba1758d2011-06-03 01:29:12 +0000257<div class="doc-section">
cristy1efc1ab2011-08-01 14:47:02 +0000258<p>A pixel is comprised of one or more color values, or <em>channels</em> (e.g. red pixel channel).</p>
259<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 +0000260
cristy91469932014-07-25 11:00:25 +0000261<div class="viewport">for (y=0; y &lt; (ssize_t) image->rows; y++)
262{
263 register IndexPacket
264 *indexes;
cristyba1758d2011-06-03 01:29:12 +0000265
cristy91469932014-07-25 11:00:25 +0000266 register PixelPacket
267 *q;
cristyba1758d2011-06-03 01:29:12 +0000268
cristy91469932014-07-25 11:00:25 +0000269 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
270 if (q == (PixelPacket *) NULL)
cristyba1758d2011-06-03 01:29:12 +0000271 {
cristyba1758d2011-06-03 01:29:12 +0000272 status=MagickFalse;
cristy91469932014-07-25 11:00:25 +0000273 continue;
274 }
275 indexes=GetCacheViewAuthenticIndexQueue(image_view);
276 for (x=0; x &lt; (ssize_t) image->columns; x++)
277 {
278 if ((channel &amp; RedChannel) != 0)
279 q->red=(Quantum) QuantumRange-q->red;
280 if ((channel &amp; GreenChannel) != 0)
281 q->green=(Quantum) QuantumRange-q->green;
282 if ((channel &amp; BlueChannel) != 0)
283 q->blue=(Quantum) QuantumRange-q->blue;
284 if (((channel &amp; IndexChannel) != 0) &amp;&amp;
285 (image->colorspace == CMYKColorspace))
286 indexes[x]=(IndexPacket) QuantumRange-indexes[x];
287 q++;
cristyba1758d2011-06-03 01:29:12 +0000288 }
cristy91469932014-07-25 11:00:25 +0000289 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
290 status=MagickFalse;
291}
292</div>
cristyba1758d2011-06-03 01:29:12 +0000293
cristyeed6cb62012-01-28 19:38:34 +0000294<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 +0000295
cristy91469932014-07-25 11:00:25 +0000296<div class="viewport">for (y=0; y &lt; (ssize_t) image->rows; y++)
297{
298 register Quantum
299 *q;
cristyba1758d2011-06-03 01:29:12 +0000300
cristy91469932014-07-25 11:00:25 +0000301 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
302 if (q == (Quantum *) NULL)
cristy29c5c992011-06-25 13:58:49 +0000303 {
cristy29c5c992011-06-25 13:58:49 +0000304 status=MagickFalse;
cristy91469932014-07-25 11:00:25 +0000305 continue;
306 }
307 for (x=0; x &lt; (ssize_t) image->columns; x++)
308 {
309 if ((GetPixelRedTraits(image) &amp; UpdatePixelTrait) != 0)
310 SetPixelRed(image,QuantumRange-GetPixelRed(image,q),q);
311 if ((GetPixelGreenTraits(image) &amp; UpdatePixelTrait) != 0)
312 SetPixelGreen(image,QuantumRange-GetPixelGreen(image,q),q);
313 if ((GetPixelBlueTraits(image) &amp; UpdatePixelTrait) != 0)
314 SetPixelBlue(image,QuantumRange-GetPixelBlue(image,q),q);
315 if ((GetPixelBlackTraits(image) &amp; UpdatePixelTrait) != 0)
316 SetPixelBlack(image,QuantumRange-GetPixelBlack(image,q),q);
317 if ((GetPixelAlphaTraits(image) &amp; UpdatePixelTrait) != 0)
318 SetPixelAlpha(image,QuantumRange-GetPixelAlpha(image,q),q);
319 q+=GetPixelChannels(image);
cristy29c5c992011-06-25 13:58:49 +0000320 }
cristy91469932014-07-25 11:00:25 +0000321 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
322 status=MagickFalse;
323}
324</div>
cristy29c5c992011-06-25 13:58:49 +0000325
cristy1efc1ab2011-08-01 14:47:02 +0000326<p>Let's do that again but take full advantage of the new variable pixel channel support:</p>
cristy29c5c992011-06-25 13:58:49 +0000327
cristy91469932014-07-25 11:00:25 +0000328<div class="viewport">for (y=0; y &lt; (ssize_t) image->rows; y++)
329{
330 register Quantum
331 *q;
332
333 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
334 if (q == (Quantum *) NULL)
335 {
336 status=MagickFalse;
337 continue;
338 }
339 for (x = 0; x &lt; (ssize_t) image->columns; x++)
340 {
341 register ssize_t
342 i;
343
344 if (GetPixelReadMask(image,q) == 0)
cristy29c5c992011-06-25 13:58:49 +0000345 {
cristy91469932014-07-25 11:00:25 +0000346 q+=GetPixelChannels(image);
cristy29c5c992011-06-25 13:58:49 +0000347 continue;
348 }
cristy91469932014-07-25 11:00:25 +0000349 for (i=0; i &lt; (ssize_t) GetPixelChannels(image); i++)
cristy1efc1ab2011-08-01 14:47:02 +0000350 {
cristy91469932014-07-25 11:00:25 +0000351 PixelChannel channel=GetPixelChannelChannel(image,i);
352 PixelTrait traits=GetPixelChannelTraits(image,channel);
353 if ((traits &amp; UpdatePixelTrait) == 0)
354 continue;
355 q[i]=QuantumRange-q[i];
cristy1efc1ab2011-08-01 14:47:02 +0000356 }
cristy91469932014-07-25 11:00:25 +0000357 q+=GetPixelChannels(image);
cristyba1758d2011-06-03 01:29:12 +0000358 }
cristy91469932014-07-25 11:00:25 +0000359 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
360 status=MagickFalse;
361}
362</div>
cristyba1758d2011-06-03 01:29:12 +0000363
cristyeed6cb62012-01-28 19:38:34 +0000364<p>Note, how we use GetPixelChannels() to advance to the next set of pixel channels.</p>
cristye6e84152011-06-06 14:16:49 +0000365
cristy8ee7f242013-06-20 16:08:44 +0000366<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 +0000367
cristy91469932014-07-25 11:00:25 +0000368<p>As a consequence of using an array structure for variable pixel channels, auto-vectorization compilers have additional opportunities to speed up pixel loops.</p>
369
cristy149d58c2013-08-07 19:44:54 +0000370<h4>Pixel Accessors</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000371<p>Use accessors to get or set pixel channels:</p>
cristy87a7f072011-07-01 00:08:52 +0000372
373<pre class="text">
cristy8ee7f242013-06-20 16:08:44 +0000374 GetPixela() SetPixela()
375 GetPixelAlpha() SetPixelAlpha()
376 GetPixelb() SetPixelb()
377 GetPixelBlack() SetPixelBlack()
378 GetPixelBlue() SetPixelBlue()
379 GetPixelCb() SetPixelCb()
380 GetPixelCr() SetPixelCr()
381 GetPixelCyan() SetPixelCyan()
382 GetPixelGray() SetPixelGray()
383 GetPixelGreen() SetPixelGreen()
384 GetPixelIndex() SetPixelIndex()
385 GetPixelL() SetPixelL()
386 GetPixelMagenta() SetPixelMagenta()
387 GetPixelReadMask() SetPixelReadMask()
388 GetPixelWriteMask() SetPixelWriteMask()
389 GetPixelMetacontentExtent() SetPixelMetacontentExtent()
390 GetPixelOpacity() SetPixelOpacity()
391 GetPixelRed() SetPixelRed()
392 GetPixelYellow() SetPixelYellow()
393 GetPixelY() SetPixelY()
cristy87a7f072011-07-01 00:08:52 +0000394</pre>
395
cristy8ee7f242013-06-20 16:08:44 +0000396<p>You can find these accessors defined in the header file, <code>MagickCore/pixel-accessor.h</code></p>
cristy87a7f072011-07-01 00:08:52 +0000397
cristy149d58c2013-08-07 19:44:54 +0000398<h4>Pixel Traits</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000399<p>Each pixel channel includes one or more of these traits:</p>
cristya4dfb122011-07-07 19:01:57 +0000400<dl>
401<dt>Undefined</dt>
cristy149d58c2013-08-07 19:44:54 +0000402<dd>no traits associated with this pixel channel</dd>
cristy1efc1ab2011-08-01 14:47:02 +0000403<dt>Copy</dt>
cristy149d58c2013-08-07 19:44:54 +0000404<dd>do not update this pixel channel, just copy it</dd>
cristy1efc1ab2011-08-01 14:47:02 +0000405<dt>Update</dt>
cristy149d58c2013-08-07 19:44:54 +0000406<dd>update this pixel channel</dd>
cristya4dfb122011-07-07 19:01:57 +0000407<dt>Blend</dt>
cristy149d58c2013-08-07 19:44:54 +0000408<dd>blend this pixel channel with the alpha mask if it's enabled</dd>
cristya4dfb122011-07-07 19:01:57 +0000409</dl>
410<p>We provide these methods to set and get pixel traits:</p>
411<pre class="text">
cristy8ee7f242013-06-20 16:08:44 +0000412 GetPixelAlphaTraits() SetPixelAlphaTraits()
413 GetPixelBlackTraits() SetPixelBlackTraits()
414 GetPixelBlueTraits() SetPixelBlueTraits()
415 GetPixelCbTraits() SetPixelCbTraits()
416 GetPixelChannelTraits() SetPixelChannelTraits()
417 GetPixelCrTraits() SetPixelCrTraits()
418 GetPixelGrayTraits() SetPixelGrayTraits()
419 GetPixelGreenTraits() SetPixelGreenTraits()
420 GetPixelIndexTraits() SetPixelIndexTraits()
421 GetPixelMagentaTraits() SetPixelMagentaTraits()
422 GetPixelRedTraits() SetPixelRedTraits()
423 GetPixelYellowTraits() SetPixelYellowTraits()
424 GetPixelYTraits() SetPixelYTraits()
cristya4dfb122011-07-07 19:01:57 +0000425</pre>
cristy1efc1ab2011-08-01 14:47:02 +0000426<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 +0000427<pre class="text">
cristy1efc1ab2011-08-01 14:47:02 +0000428 PopPixelChannelMap()
cristy1efc1ab2011-08-01 14:47:02 +0000429 SetPixelChannelMap()
cristyeed6cb62012-01-28 19:38:34 +0000430 SetPixelChannelMask()
cristya4dfb122011-07-07 19:01:57 +0000431</pre>
432
cristy8ee7f242013-06-20 16:08:44 +0000433<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 +0000434<pre class="text">
435 NegateImageChannel(image,channel);
436</pre>
437<p>we use:</p>
438<pre class="text">
cristyeed6cb62012-01-28 19:38:34 +0000439 channel_mask=SetPixelChannelMask(image,channel);
440 NegateImage(image,exception);
441 (void) SetPixelChannelMap(image,channel_mask);
cristya4dfb122011-07-07 19:01:57 +0000442</pre>
443
cristy149d58c2013-08-07 19:44:54 +0000444<h4>Pixel User Channels</h4>
cristyeed6cb62012-01-28 19:38:34 +0000445<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 +0000446<h4>Pixel Metacontent</h4>
cristyeed6cb62012-01-28 19:38:34 +0000447<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 +0000448<pre class="text">
449 SetImageMetacontentExtent()
450 GetImageMetacontentExtent()
451 GetVirtualMetacontent()
452 GetAuthenticMetacontent()
453 GetCacheViewAuthenticMetacontent()
454 GetCacheViewVirtualMetacontent()
455</pre>
cristyba1758d2011-06-03 01:29:12 +0000456</div>
457
458<h2><a id="alpha"></a>Alpha</h2>
459<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000460<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 +0000461</div>
cristy87a7f072011-07-01 00:08:52 +0000462<h2><a id="grayscale"></a>Grayscale</h2>
463<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000464<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>
465</div>
466
467<h2><a id="mask"></a>Masks</h2>
468<div class="doc-section">
cristy149d58c2013-08-07 19:44:54 +0000469<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 +0000470<pre class="text">
471identify -verbose -clip r statue.tif
472identify -verbose -mask r mask.png statue.tif
473</pre>
cristy87a7f072011-07-01 00:08:52 +0000474</div>
cristyba1758d2011-06-03 01:29:12 +0000475
cristy751980d2012-06-03 23:18:35 +0000476<h2><a id="core"></a>MagickCore API</h2>
cristy1efc1ab2011-08-01 14:47:02 +0000477<div class="doc-section">
cristyeed6cb62012-01-28 19:38:34 +0000478<p>Almost all image processing algorithms are now channel aware.</p>
cristy1efc1ab2011-08-01 14:47:02 +0000479<p>MagickCore, version 7, adds an ExceptionInfo argument to those methods that lacked it in version 6, e.g. NegateImage(image,MagickTrue,exception);</p>
480<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 +0000481<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>
482<p>The InterpolatePixelMethod enum is now PixelInterpolateMethod.</p>
483<p>The IntegerPixel storage type is removed (use LongPixel instead) and LongLongPixel is added</p>
484<p>Image signatures have changed to account for variable pixel channels.</p>
485<p>All color packet structures, PixelPacket, LongPacket, and DoublePacket, are consolidated to a single color structure, PixelInfo.</p>
486</div>
487<h2><a id="headers"></a>Header Files</h2>
488<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000489<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>
cristy91469932014-07-25 11:00:25 +0000490<pre class="code">#include &lt;MagickCore/MagickCore.h>
491#include &lt;MagickWand/MagickWand.h>
cristyeed6cb62012-01-28 19:38:34 +0000492</pre>
cristy1efc1ab2011-08-01 14:47:02 +0000493</div>
cristy751980d2012-06-03 23:18:35 +0000494
cristyba1758d2011-06-03 01:29:12 +0000495<h2><a id="deprecate"></a>Deprecated Features Removed</h2>
496<div class="doc-section">
cristy8ee7f242013-06-20 16:08:44 +0000497<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 +0000498
cristy91469932014-07-25 11:00:25 +0000499<pre class="code">MagickCore-config
500MagickWand-config
cristyba1758d2011-06-03 01:29:12 +0000501</pre>
cristyeed6cb62012-01-28 19:38:34 +0000502<p>The FilterImage() method has been removed. Use ConvolveImage() instead.</p>
cristyba1758d2011-06-03 01:29:12 +0000503
cristy149d58c2013-08-07 19:44:54 +0000504<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 +0000505</div>
cristy751980d2012-06-03 23:18:35 +0000506
507
508<h2><a id="cli"></a>Shell API or Command-line Interface</h2>
cristy1efc1ab2011-08-01 14:47:02 +0000509<div class="doc-section">
cristy751980d2012-06-03 23:18:35 +0000510
511<p>As mentioned the primary focus of the changes to the Shell API or Command
512Line Interface is the the abstration so that not only can 'options' be read
513from command line arguments, but also from a file (script) or from a file
514stream (interactive commands, or co-processing). </p>
515
516<p>To do this the CLI parser needed to be re-written, so as to always perform
517all options, in a strict, do-it-as-you-see it order. Previously in IMv6
518options were performed in groups (known as 'FireOptions), this awkwardness is
519now gone. However the strict order means that you can no long give operations
520before providing an image for the operations to work on. To do so will now
521produce an error. </p>
522
523<p>Error reporting is now reporting exactly which option (by argument count on
524command line, or line,column in scripts) caused the 'exception'. This is not
525complete as yet but getting better. Also not complete is 'regard-warnings'
526handling or its replacement, which will allow you to ignore reported errors
527and continue processing (as appropriate due to error) in co-processes or
528interactive usage. </p>
529
530<p>The parenthesis options used to 'push' the current image list, and image
cristy8ee7f242013-06-20 16:08:44 +0000531settings (EG: '<code>(</code>' and '<code>)</code>' ) on to a stack now has
cristy91469932014-07-25 11:00:25 +0000532a completely separate image settings stack. That is parenthesis 'push/pull'
cristy8ee7f242013-06-20 16:08:44 +0000533image lists, and curly braces (EG: '<code>{</code>' and '<code>}</code>' ) will
cristy751980d2012-06-03 23:18:35 +0000534'push/pull' image settings. </p>
535
536<p>Of course due to the previously reported changes to the underlying channel
537handling will result be many side effects to almost all options. Here are some
538specific </p>
539
540<p>Most algorithms update the red, green, blue, black (for CMYK), and alpha
541channels. Most operators will blend alpha the other color channels, but other
542operators (and situations) may require this blending to be disabled, and is
543currently done by removing alpha from teh active channels via
cristy8ee7f242013-06-20 16:08:44 +0000544<code>-channel</code> option. (e.g. <code>convert castle.gif -channel RGB
545-negate castle.png</code>). </p>
cristy751980d2012-06-03 23:18:35 +0000546
547<p>Reading gray-scale images will generate a image with only one channel. If
cristy8ee7f242013-06-20 16:08:44 +0000548that image is to then accept color the <code>-colorspace</code> setting needs to
cristy751980d2012-06-03 23:18:35 +0000549be applied to expand the one channel into separate RGB (or other) channels.
550</p>
551
552<h3>Command Changes</h3>
553<dl>
554<dt>magick</dt>
cristy8ee7f242013-06-20 16:08:44 +0000555<dd>The "<code>magick</code>" command is the new primary command of the Shell
556 API, replacing the old "<code>convert</code>" command. This allows you to
557 create a 'magick script' of the form "<code>#!/path/to/command/magick
558 -script</code>", or pipe options into a command "<code>magick -script
559 -</code>, as abackground process. </dd>
cristy751980d2012-06-03 23:18:35 +0000560
561<dt>magick-script</dt>
cristy8ee7f242013-06-20 16:08:44 +0000562<dd>This the same as "<code>magick</code>", (only command name is different)
563 but which has an implict "<code>-script</code>" option. This allows you to
564 use it in an "<code>env</code>" style script form. That is a magick script
565 starts with the 'she-bang' line of "<code>#!/usr/bin/env
566 magick-script</code>" allowing the script interpreter to be found anywhere
567 on the users command "<code>PATH</code>". This is required to get around
cristy751980d2012-06-03 23:18:35 +0000568 a "one argument she-bang bug" that is common on most UNIX systems
569 (including Linux, but not MacOSX).</dd>
570
571</dl>
572
cristy8ee7f242013-06-20 16:08:44 +0000573<h3>Behavorial Changes</h3>
574<p>Some options have changed in ImageMagick version 7. These include:</p>
575<dl>
576<dt>-combine</dt>
577<dd>This option now requires an argument, the image colorspace (e.g. -combine sRGB).</dd>
578</dl>
579
cristy751980d2012-06-03 23:18:35 +0000580<h3>New Options</h3>
581<p>ImageMagick version 7 supports these new options, though most are limited
cristy8ee7f242013-06-20 16:08:44 +0000582to the "<code>magick</code>" command, or to use in "<code>magick</code>"
cristy751980d2012-06-03 23:18:35 +0000583scripts.</p>
584
585<dl>
586<dt>{ ... }</dt>
587<dd>Save (and restore) the current image settings (internally known as the
588 "image_info" structure). This is automatically done with parenthesis (EG:
cristy8ee7f242013-06-20 16:08:44 +0000589 '<code>(</code>' and '<code>)</code>') is "<code>-regard-parenthesis</code>" has
cristy751980d2012-06-03 23:18:35 +0000590 been set, just as in IMv6. Caution is advised to prevent un-balanced
cristy149d58c2013-08-07 19:44:54 +0000591 braces errors.</dd>
cristy751980d2012-06-03 23:18:35 +0000592
593<dt>--</dt>
cristy8ee7f242013-06-20 16:08:44 +0000594<dd>End of options, to be used in IMv7 "<code>mogrify</code>" command to
cristy751980d2012-06-03 23:18:35 +0000595 explictally separate the operations to be applied and the images that
596 are to be processed 'in-place'. (not yet implemented). However if
cristy8ee7f242013-06-20 16:08:44 +0000597 not provided, "<code>-read</code>" can still be used to differentiate
cristy751980d2012-06-03 23:18:35 +0000598 secondary image reads (for use in things like alpha composition) from
599 the 'in-place' image being processed. </dd>
600
601<dd>In other commands (such as "magick") it is equivelent to a explict
cristy8ee7f242013-06-20 16:08:44 +0000602 "<code>-read</code>" (see below) of the next option as a image (as it was in
cristy751980d2012-06-03 23:18:35 +0000603 IMv6). </dd>
604
605<dt>-channel-fx <em class="arg">expression</em> </dt>
606<dd>
607<p>exchange, extract, or copy one or more image channels.</p>
608
cristy8ee7f242013-06-20 16:08:44 +0000609<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 +0000610
611<pre class="text">
612 &lt;=&gt; exchange two channels (e.g. red&lt;=&gt;blue)
613 =&gt; copy one channel to another channel (e.g. red=&gt;green)
614 = assign a constant value to a channel (e.g. red=50%)
615 , write new image with channels in the specified order (e.g. red, green)
cristy8ee7f242013-06-20 16:08:44 +0000616 ; add a new output image for the next set of channel operations (e.g. red; green; blue)
cristy91469932014-07-25 11:00:25 +0000617 | move to the next input image for the source of channel data (e.g. | gray=>alpha)
cristy751980d2012-06-03 23:18:35 +0000618</pre>
619
620<p>For example, to create 3 grayscale images from the red, green, and blue channels of an image, use:</p>
621
622<pre class="text">
623 -channel-fx "red; green; blue"
624</pre>
625
626<p>A channel without an operation symbol implies separate (i.e, semicolon).</p>
627
cristy8ee7f242013-06-20 16:08:44 +0000628<p>Here we take an sRGB image and a grayscale image and inject the grayscale image into the alpha channel:</p>
629<pre class="text">
cristy91469932014-07-25 11:00:25 +0000630 convert wizard.png mask.pgm -channel-fx '| gray=>alpha' wizard-alpha.png
cristy8ee7f242013-06-20 16:08:44 +0000631</pre>
632<p>Use a similar command to define a read mask:</p>
633<pre class="text">
cristy91469932014-07-25 11:00:25 +0000634 convert wizard.png mask.pgm -channel-fx '| gray=>read-mask' wizard-mask.png
cristy8ee7f242013-06-20 16:08:44 +0000635</pre>
636
637<p>Add <code>-debug pixel</code> prior to the <code>-channel-fx</code> option to track the channel morphology.</p>
638
cristy751980d2012-06-03 23:18:35 +0000639</dd>
640
641<dt>-exit</dt>
642<dd>Stop processing at this point. No further options will be processed after
cristy8ee7f242013-06-20 16:08:44 +0000643 this option. Can be used in a script to force the "<code>magick</code>"
cristy751980d2012-06-03 23:18:35 +0000644 command to exit, without actually closing the pipeline that it is
645 processing options from. </dd>
646
cristy8ee7f242013-06-20 16:08:44 +0000647<dd>May also be used as a 'final' option on the "<code>magick</code>" command
cristy751980d2012-06-03 23:18:35 +0000648 line, instead of a implicit output image, to completely prevent any image
cristy8ee7f242013-06-20 16:08:44 +0000649 write. ASIDE: even the "<code>NULL:</code>" coder requires at least one
cristy751980d2012-06-03 23:18:35 +0000650 image, for it to 'not write'! This option does not require any images at
651 all. </dd>
652
653<dt>-read {image}</dt>
654<dd>Explicit read of an image, rather than an implicit read. This allows you
655 to read from filenames that start with an 'option' character, and which
656 otherwise could be mistaken as an option (unknown or otherwise). This will
cristy8ee7f242013-06-20 16:08:44 +0000657 eventually be used in "<code>mogrify</code>" to allow the reading of
cristy751980d2012-06-03 23:18:35 +0000658 secondary images, and allow the use of image list operations within that
659 command. </dd>
660
661<dt>-region</dt>
cristy8ee7f242013-06-20 16:08:44 +0000662<dd>not yet implemented in "<code>magick</code>". (very soon)</dd>
cristy751980d2012-06-03 23:18:35 +0000663
664<dt>-script {file}</dt>
cristy8ee7f242013-06-20 16:08:44 +0000665<dd>In "<code>magick</code>", stop the processing of command line arguments as
cristy751980d2012-06-03 23:18:35 +0000666 image operations, and read all further options from the given file or
667 pipeline.</dd>
668
669</dl>
670
671<h3>Changed Options</h3>
672<p>These options are known to have changed, in some way.</p>
673<dl>
674<dt>-negate</dt>
675<dd>currently negates all channels, including alpha if present. As such you
676 may need to use the -channel option to prevent alpha negation. </dd>
677
678<dt>-convolve</dt>
679<dd>option no longer normalizes the kernel argument (unless some type of
680 masking is involved, such as alpha blending) and accepts named kernels
cristy91469932014-07-25 11:00:25 +0000681 (see <a href="http://www.imagemagick.org/Usage/convolve/" >IM Examples,
682 Convolve</a> ) as well as non-square <a
683 href="http://www.imagemagick.org/Usage/morphology/#user">user defined
cristy8ee7f242013-06-20 16:08:44 +0000684 kernels</a>. Use <code>-define convolve:normalize=true</code> on the command-line to force normalization.</dd>
cristy751980d2012-06-03 23:18:35 +0000685
686</dl>
687
cristy8ee7f242013-06-20 16:08:44 +0000688<h3>Deprecated warning given, but will work (for now)</h3>
cristy751980d2012-06-03 23:18:35 +0000689<dl>
690<dt>-affine</dt>
cristy8ee7f242013-06-20 16:08:44 +0000691<dd>Replaced by <code>-draw "affine ..."</code>. (see transform)</dd>
cristy751980d2012-06-03 23:18:35 +0000692<dt>-average</dt>
cristy8ee7f242013-06-20 16:08:44 +0000693<dd>Replaced by <code>-evaluate-sequence Mean</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000694<dt>-box</dt>
cristy8ee7f242013-06-20 16:08:44 +0000695<dd>Replaced by <code>-undercolor</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000696<dt>-deconstruct</dt>
cristy8ee7f242013-06-20 16:08:44 +0000697<dd>Replaced by <code>-layers CompareAny</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000698<dt>-gaussian</dt>
cristy8ee7f242013-06-20 16:08:44 +0000699<dd>Replaced by <code>-gaussian-blur</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000700<dt>-/+map</dt>
cristy8ee7f242013-06-20 16:08:44 +0000701<dd>Replaced by <code>-/+remap</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000702<dt>-/+matte</dt>
cristy8ee7f242013-06-20 16:08:44 +0000703<dd>Replaced by <code>-alpha Set/Off</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000704<dt>-transform</dt>
cristy8ee7f242013-06-20 16:08:44 +0000705<dd>Replaced by <code>-distort Affine "..."</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000706</dl>
707
cristy8ee7f242013-06-20 16:08:44 +0000708<h3>Deprecated warning given, and ignored (for now)</h3>
cristy751980d2012-06-03 23:18:35 +0000709<p>Almost 'plus' (+) option that did not do anything has been marked as
cristy8ee7f242013-06-20 16:08:44 +0000710deprecated, and does nothing. It does not even have associated code. For
cristy751980d2012-06-03 23:18:35 +0000711example "+annotate", "+resize", "+clut", and "+draw" .</p>
712
713<dl>
714<dt>-affinity</dt>
cristy149d58c2013-08-07 19:44:54 +0000715<dd>Replaced by <code>-affinity</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000716<dt>-maximum</dt>
cristy8ee7f242013-06-20 16:08:44 +0000717<dd>Replaced by <code>-evaluate-sequence Max</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000718<dt>-median</dt>
cristy8ee7f242013-06-20 16:08:44 +0000719<dd>Replaced by <code>-evaluate-sequence Median</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000720<dt>-minimum</dt>
cristy8ee7f242013-06-20 16:08:44 +0000721<dd>Replaced by <code>-evaluate-sequence Min</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000722<dt>-recolor</dt>
cristy149d58c2013-08-07 19:44:54 +0000723<dd>Replaced by <code>-color-matrix</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000724</dl>
725
726<h3>Removed / Replaced Options ("no such option" error and abort)</h3>
727
728<dl>
729<dt>-origin</dt>
730<dd>old option, unknown meaning.</dd>
731<dt>-pen</dt>
cristy149d58c2013-08-07 19:44:54 +0000732<dd>Replaced by <code>-fill</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000733<dt>-passphrase</dt>
734<dd>old option, unknown meaning</dd>
735</dl>
cristy149d58c2013-08-07 19:44:54 +0000736</div>
cristyba1758d2011-06-03 01:29:12 +0000737<h2><a id="summary"></a>Version 7 Change Summary</h2>
738<div class="doc-section">
cristye6e84152011-06-06 14:16:49 +0000739<p>Changes from ImageMagick version 6 to version 7 are summarized here:</p>
cristy8ee7f242013-06-20 16:08:44 +0000740<h4>High Dynamic Range Imaging</h4>
741<dl>
742<li>ImageMagick version 7 enables HDRI by default. Expect more accurate image processing results with higher memory requirement and possible slower processing times.</li>
743</dl>
744<h4>Pixels</h4>
cristyba1758d2011-06-03 01:29:12 +0000745<dl>
cristy1efc1ab2011-08-01 14:47:02 +0000746<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>
747<li>Use convenience macros to access pixel channels (e.g. GetPixelRed(), SetPixelRed()).</li>
cristy8ee7f242013-06-20 16:08:44 +0000748<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>
749<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 +0000750<li>Use GetPixelChannels() to advance to the next set of pixel channels.</li>
751<li>Use the <em>metacontent</em> channel to associate metacontent with each pixel.</li>
cristyeed6cb62012-01-28 19:38:34 +0000752<li>All color packet structures, PixelPacket, LongPacket, and DoublePacket, are consolidated to a single color structure, PixelInfo.</li>
cristyba1758d2011-06-03 01:29:12 +0000753</dl>
cristy8ee7f242013-06-20 16:08:44 +0000754<h4>Alpha</h4>
cristyba1758d2011-06-03 01:29:12 +0000755<dl>
756<li>We support alpha rather than opacity (0 transparent; QuantumRange opaque).</li>
cristy1efc1ab2011-08-01 14:47:02 +0000757<li>Use GetPixelAlpha() or SetPixelAlpha() to get or set the alpha pixel channel value.</li>
cristyba1758d2011-06-03 01:29:12 +0000758</dl>
cristy8ee7f242013-06-20 16:08:44 +0000759<h4>Grayscale</h4>
cristy87a7f072011-07-01 00:08:52 +0000760<dl>
cristy1efc1ab2011-08-01 14:47:02 +0000761<li>Grayscale images consume one pixel channel in ImageMagick version 7. To process RGB, set the colorspace to RGB (e.g. -colorspace rgb).</li>
762</dl>
cristy8ee7f242013-06-20 16:08:44 +0000763<h4>MagickCore API</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000764<dl>
cristyeed6cb62012-01-28 19:38:34 +0000765<li>Almost all image processing algorithms are now channel aware.</li>
cristy1efc1ab2011-08-01 14:47:02 +0000766<li>MagickCore, version 7, adds an ExceptionInfo argument to those methods that lacked it in version 6, e.g. NegateImage(image,MagickTrue,exception);</li>
767<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 +0000768<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>
769<li>The InterpolatePixelMethod enum is now PixelInterpolateMethod.</li>
770<li>To account for variable pixel channels, images may now return a different signature.</li>
cristy87a7f072011-07-01 00:08:52 +0000771</dl>
cristy8ee7f242013-06-20 16:08:44 +0000772<h4>Deprecated Methods</h4>
cristyba1758d2011-06-03 01:29:12 +0000773<dl>
cristy2dcd6822011-06-13 16:21:20 +0000774<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 +0000775<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 +0000776<li>The FilterImage() method has been removed. Use ConvolveImage() instead.</li>
cristyba1758d2011-06-03 01:29:12 +0000777</dl>
778</div>
cristy751980d2012-06-03 23:18:35 +0000779
cristyad41c0c2012-10-31 00:49:28 +0000780</div>
781
782<div id="linkbar">
cristyac1b4322013-07-28 13:58:06 +0000783 <span id="linkbar-west"> </span>
cristy8ee7f242013-06-20 16:08:44 +0000784
cristyad41c0c2012-10-31 00:49:28 +0000785 <span id="linkbar-center">
cristy149d58c2013-08-07 19:44:54 +0000786 <a href="../discourse-server">Discourse Server</a>
cristy91469932014-07-25 11:00:25 +0000787 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
cristy149d58c2013-08-07 19:44:54 +0000788 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
cristy8ee7f242013-06-20 16:08:44 +0000789 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
cristyad41c0c2012-10-31 00:49:28 +0000790 </span>
cristyac1b4322013-07-28 13:58:06 +0000791 <span id="linkbar-east"> </span>
cristy149d58c2013-08-07 19:44:54 +0000792</div>
793<div class="footer">
cristyb56bb242014-11-25 17:12:48 +0000794 <span id="footer-west">© 1999-2015 ImageMagick Studio LLC</span>
cristy149d58c2013-08-07 19:44:54 +0000795 <span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
796</div>
797<div style="clear: both; margin: 0; width: 100%; "></div>
cristyad41c0c2012-10-31 00:49:28 +0000798</body>
799</html>