blob: 4dd410602c26bb33c640737a693ff68075f5d913 [file] [log] [blame]
cristy29dc8652015-05-12 16:26:21 +00001<!DOCTYPE html>
cristyd2432012015-05-04 23:15:15 +00002<html lang="en">
cristyad41c0c2012-10-31 00:49:28 +00003<head>
cristy29f2c972015-07-28 13:37:46 +00004 <title>ImageMagick: Porting to ImageMagick Version 7</title>
cristyd2432012015-05-04 23:15:15 +00005 <meta http-equiv="content-type" content="text/html; charset=utf-8">
cristyd2432012015-05-04 23:15:15 +00006 <meta name="application-name" content="ImageMagick">
7 <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.">
8 <meta name="application-url" content="http://www.imagemagick.org">
9 <meta name="generator" content="PHP">
10 <meta name="keywords" content="porting, to, imagemagick, version, 7, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
11 <meta name="rating" content="GENERAL">
12 <meta name="robots" content="INDEX, FOLLOW">
13 <meta name="generator" content="ImageMagick Studio LLC">
14 <meta name="author" content="ImageMagick Studio LLC">
15 <meta name="revisit-after" content="2 DAYS">
16 <meta name="resource-type" content="document">
cristy2f563d42015-05-06 23:36:51 +000017 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC">
cristyd2432012015-05-04 23:15:15 +000018 <meta name="distribution" content="Global">
cristy44443b92015-05-05 00:06:07 +000019 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
cristy354f1172015-07-29 14:03:48 +000020 <link rel="icon" href="../images/wand.png">
21 <link rel="shortcut icon" href="../images/wand.ico">
22 <link rel="stylesheet" href="../css/magick.html">
cristyad41c0c2012-10-31 00:49:28 +000023</head>
cristyd2432012015-05-04 23:15:15 +000024<body>
cristyad41c0c2012-10-31 00:49:28 +000025<div class="main">
cristyd2432012015-05-04 23:15:15 +000026<div class="magick-masthead">
27 <div class="container">
cristy29f2c972015-07-28 13:37:46 +000028 <script async src="http://localhost/pagead/js/adsbygoogle.js"></script>
29 <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3129977114552745" data-ad-slot="6345125851" data-ad-format="auto"></ins>
30 <script>
31 (adsbygoogle = window.adsbygoogle || []).push({});
cristyd2432012015-05-04 23:15:15 +000032 </script>
cristyd2432012015-05-04 23:15:15 +000033 <nav class="magick-nav">
cristy44443b92015-05-05 00:06:07 +000034 <a class="magick-nav-item " href="../index.html">Home</a>
cristyea2793e2015-05-31 16:52:26 +000035 <a class="magick-nav-item " href="binary-releases.html">Download</a>
cristyd2432012015-05-04 23:15:15 +000036 <a class="magick-nav-item " href="command-line-tools.html">Tools</a>
37 <a class="magick-nav-item " href="command-line-options.html">Options</a>
cristyea2793e2015-05-31 16:52:26 +000038 <a class="magick-nav-item " href="resources.html">Resources</a>
39 <a class="magick-nav-item " href="api.html">Develop</a>
cristy5b8fe762015-06-09 16:24:03 +000040 <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
cristya1890f02015-05-15 23:32:44 +000041 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
cristyd2432012015-05-04 23:15:15 +000042 </nav>
43 </div>
44</div>
45<div class="container">
46<div class="magick-header">
cristyad41c0c2012-10-31 00:49:28 +000047
cristyd2432012015-05-04 23:15:15 +000048<p class="text-center"><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 +000049
cristyd2432012015-05-04 23:15:15 +000050<p class="lead magick-description">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>
cristyba1758d2011-06-03 01:29:12 +000051
cristy29f2c972015-07-28 13:37:46 +000052<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, <var>pixel[i]</var>, or use an accessor method such as GetPixelRed() or SetPixelRed(). There are some modest changes to the MagickCore and MagickWand API's. The Magick++ and PerlMagick API's have not changed and matches that of the ImageMagick version 6.</p>
cristy29c5c992011-06-25 13:58:49 +000053
cristy751980d2012-06-03 23:18:35 +000054<p>The shell API (command line) of ImageMagick version 7 is also undergoing
55a major overhaul, with specific emphasis on the ability to read 'options' not
56only from the command line, but also from scripts, and file streams. This
57allows for the use of 'co-processing' programming techniques or performing
58image handling using 'deamon/server backends', and even multi-machine
59distributed processing.</p>
60
61<p>With shell API overhaul other improvements are being made, including:
cristy8ee7f242013-06-20 16:08:44 +000062better reporting of which option failed, the consolidation and deprecation of
cristy751980d2012-06-03 23:18:35 +000063options, and more global use of 'image properities' (more commonly known as
64'percent escapes' in option arguments. </p>
65
cristy91469932014-07-25 11:00:25 +000066<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 +000067
cristy91469932014-07-25 11:00:25 +000068<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 +000069
cristyd2432012015-05-04 23:15:15 +000070<h2 class="magick-header"><a id="hdri"></a>High Dynamic Range Imaging</h2>
cristy37b3d442015-02-28 14:00:30 +000071<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. If you see differences in the results of your version 6 command-line with version 7, it is likely due to HDRI. You may need to add <code>-clamp</code> to your command-line to constrain pixels to the 0 .. QuantumRange range, or disable HDRI when you build ImaegMagick version 7. 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>
cristy149d58c2013-08-07 19:44:54 +000072
cristyd2432012015-05-04 23:15:15 +000073<h2 class="magick-header"><a id="channels"></a>Pixel Channels</h2>
74<p>A pixel is comprised of one or more color values, or <var>channels</var> (e.g. red pixel channel).</p>
cristy1efc1ab2011-08-01 14:47:02 +000075<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 +000076
cristyd2432012015-05-04 23:15:15 +000077<code>
78<textarea class="form-control" rows="15">for (y=0; y &lt; (ssize_t) image-&gt;rows; y++)
cristy91469932014-07-25 11:00:25 +000079{
80 register IndexPacket
81 *indexes;
cristyba1758d2011-06-03 01:29:12 +000082
cristy91469932014-07-25 11:00:25 +000083 register PixelPacket
84 *q;
cristyba1758d2011-06-03 01:29:12 +000085
cristyd2432012015-05-04 23:15:15 +000086 q=GetCacheViewAuthenticPixels(image_view,0,y,image-&gt;columns,1,exception);
cristy91469932014-07-25 11:00:25 +000087 if (q == (PixelPacket *) NULL)
cristyba1758d2011-06-03 01:29:12 +000088 {
cristyba1758d2011-06-03 01:29:12 +000089 status=MagickFalse;
cristy91469932014-07-25 11:00:25 +000090 continue;
91 }
92 indexes=GetCacheViewAuthenticIndexQueue(image_view);
cristyd2432012015-05-04 23:15:15 +000093 for (x=0; x &lt; (ssize_t) image-&gt;columns; x++)
cristy91469932014-07-25 11:00:25 +000094 {
95 if ((channel &amp; RedChannel) != 0)
cristyd2432012015-05-04 23:15:15 +000096 q-&gt;red=(Quantum) QuantumRange-q-&gt;red;
cristy91469932014-07-25 11:00:25 +000097 if ((channel &amp; GreenChannel) != 0)
cristyd2432012015-05-04 23:15:15 +000098 q-&gt;green=(Quantum) QuantumRange-q-&gt;green;
cristy91469932014-07-25 11:00:25 +000099 if ((channel &amp; BlueChannel) != 0)
cristyd2432012015-05-04 23:15:15 +0000100 q-&gt;blue=(Quantum) QuantumRange-q-&gt;blue;
cristy91469932014-07-25 11:00:25 +0000101 if (((channel &amp; IndexChannel) != 0) &amp;&amp;
cristyd2432012015-05-04 23:15:15 +0000102 (image-&gt;colorspace == CMYKColorspace))
cristy91469932014-07-25 11:00:25 +0000103 indexes[x]=(IndexPacket) QuantumRange-indexes[x];
104 q++;
cristyba1758d2011-06-03 01:29:12 +0000105 }
cristy91469932014-07-25 11:00:25 +0000106 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
107 status=MagickFalse;
cristyd2432012015-05-04 23:15:15 +0000108}</textarea>
109</code>
cristyba1758d2011-06-03 01:29:12 +0000110
cristyeed6cb62012-01-28 19:38:34 +0000111<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 +0000112
cristyd2432012015-05-04 23:15:15 +0000113<code>
114<textarea class="form-control" rows="15">for (y=0; y &lt; (ssize_t) image-&gt;rows; y++)
cristy91469932014-07-25 11:00:25 +0000115{
116 register Quantum
117 *q;
cristyba1758d2011-06-03 01:29:12 +0000118
cristyd2432012015-05-04 23:15:15 +0000119 q=GetCacheViewAuthenticPixels(image_view,0,y,image-&gt;columns,1,exception);
cristy91469932014-07-25 11:00:25 +0000120 if (q == (Quantum *) NULL)
cristy29c5c992011-06-25 13:58:49 +0000121 {
cristy29c5c992011-06-25 13:58:49 +0000122 status=MagickFalse;
cristy91469932014-07-25 11:00:25 +0000123 continue;
124 }
cristyd2432012015-05-04 23:15:15 +0000125 for (x=0; x &lt; (ssize_t) image-&gt;columns; x++)
cristy91469932014-07-25 11:00:25 +0000126 {
127 if ((GetPixelRedTraits(image) &amp; UpdatePixelTrait) != 0)
128 SetPixelRed(image,QuantumRange-GetPixelRed(image,q),q);
129 if ((GetPixelGreenTraits(image) &amp; UpdatePixelTrait) != 0)
130 SetPixelGreen(image,QuantumRange-GetPixelGreen(image,q),q);
131 if ((GetPixelBlueTraits(image) &amp; UpdatePixelTrait) != 0)
132 SetPixelBlue(image,QuantumRange-GetPixelBlue(image,q),q);
133 if ((GetPixelBlackTraits(image) &amp; UpdatePixelTrait) != 0)
134 SetPixelBlack(image,QuantumRange-GetPixelBlack(image,q),q);
135 if ((GetPixelAlphaTraits(image) &amp; UpdatePixelTrait) != 0)
136 SetPixelAlpha(image,QuantumRange-GetPixelAlpha(image,q),q);
137 q+=GetPixelChannels(image);
cristy29c5c992011-06-25 13:58:49 +0000138 }
cristy91469932014-07-25 11:00:25 +0000139 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
140 status=MagickFalse;
141}
cristyd2432012015-05-04 23:15:15 +0000142</textarea>
143</code>
cristy29c5c992011-06-25 13:58:49 +0000144
cristy1efc1ab2011-08-01 14:47:02 +0000145<p>Let's do that again but take full advantage of the new variable pixel channel support:</p>
cristy29c5c992011-06-25 13:58:49 +0000146
cristyd2432012015-05-04 23:15:15 +0000147<code>
148<textarea class="form-control" rows="15">for (y=0; y &lt; (ssize_t) image-&gt;rows; y++)
cristy91469932014-07-25 11:00:25 +0000149{
150 register Quantum
151 *q;
152
cristyd2432012015-05-04 23:15:15 +0000153 q=GetCacheViewAuthenticPixels(image_view,0,y,image-&gt;columns,1,exception);
cristy91469932014-07-25 11:00:25 +0000154 if (q == (Quantum *) NULL)
155 {
156 status=MagickFalse;
157 continue;
158 }
cristyd2432012015-05-04 23:15:15 +0000159 for (x = 0; x &lt; (ssize_t) image-&gt;columns; x++)
cristy91469932014-07-25 11:00:25 +0000160 {
161 register ssize_t
162 i;
163
164 if (GetPixelReadMask(image,q) == 0)
cristy29c5c992011-06-25 13:58:49 +0000165 {
cristy91469932014-07-25 11:00:25 +0000166 q+=GetPixelChannels(image);
cristy29c5c992011-06-25 13:58:49 +0000167 continue;
168 }
cristy91469932014-07-25 11:00:25 +0000169 for (i=0; i &lt; (ssize_t) GetPixelChannels(image); i++)
cristy1efc1ab2011-08-01 14:47:02 +0000170 {
cristy91469932014-07-25 11:00:25 +0000171 PixelChannel channel=GetPixelChannelChannel(image,i);
172 PixelTrait traits=GetPixelChannelTraits(image,channel);
173 if ((traits &amp; UpdatePixelTrait) == 0)
174 continue;
175 q[i]=QuantumRange-q[i];
cristy1efc1ab2011-08-01 14:47:02 +0000176 }
cristy91469932014-07-25 11:00:25 +0000177 q+=GetPixelChannels(image);
cristyba1758d2011-06-03 01:29:12 +0000178 }
cristy91469932014-07-25 11:00:25 +0000179 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
180 status=MagickFalse;
181}
cristyd2432012015-05-04 23:15:15 +0000182</textarea>
183</code>
cristyba1758d2011-06-03 01:29:12 +0000184
cristyeed6cb62012-01-28 19:38:34 +0000185<p>Note, how we use GetPixelChannels() to advance to the next set of pixel channels.</p>
cristye6e84152011-06-06 14:16:49 +0000186
cristy7865f2d2015-03-08 13:15:40 +0000187<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 first class pixel channel and accessed as a member of the pixel array (e.g. <code>pixel[4]</code>) or with the convenience pixel accessor methods GetPixelIndex(), SetPixelIndex(), GetPixelBlack(), and SetPixelBlack().</p>
cristy29c5c992011-06-25 13:58:49 +0000188
cristy91469932014-07-25 11:00:25 +0000189<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>
190
cristy149d58c2013-08-07 19:44:54 +0000191<h4>Pixel Accessors</h4>
cristy7865f2d2015-03-08 13:15:40 +0000192<p>You can access pixel channel as array elements (e.g. <code>pixel[1]</code>) or use convenience accessors to get or set pixel channels:</p>
cristy87a7f072011-07-01 00:08:52 +0000193
cristyd2432012015-05-04 23:15:15 +0000194<pre>
cristy6e51a242015-06-07 14:41:36 +0000195GetPixela() SetPixela()
196GetPixelAlpha() SetPixelAlpha()
197GetPixelb() SetPixelb()
198GetPixelBlack() SetPixelBlack()
199GetPixelBlue() SetPixelBlue()
200GetPixelCb() SetPixelCb()
201GetPixelCr() SetPixelCr()
202GetPixelCyan() SetPixelCyan()
203GetPixelGray() SetPixelGray()
204GetPixelGreen() SetPixelGreen()
205GetPixelIndex() SetPixelIndex()
206GetPixelL() SetPixelL()
207GetPixelMagenta() SetPixelMagenta()
208GetPixelReadMask() SetPixelReadMask()
209GetPixelWriteMask() SetPixelWriteMask()
210GetPixelMetacontentExtent() SetPixelMetacontentExtent()
211GetPixelOpacity() SetPixelOpacity()
212GetPixelRed() SetPixelRed()
213GetPixelYellow() SetPixelYellow()
214GetPixelY() SetPixelY()
cristy87a7f072011-07-01 00:08:52 +0000215</pre>
216
cristy8ee7f242013-06-20 16:08:44 +0000217<p>You can find these accessors defined in the header file, <code>MagickCore/pixel-accessor.h</code></p>
cristy87a7f072011-07-01 00:08:52 +0000218
cristy149d58c2013-08-07 19:44:54 +0000219<h4>Pixel Traits</h4>
cristy1efc1ab2011-08-01 14:47:02 +0000220<p>Each pixel channel includes one or more of these traits:</p>
cristy6e51a242015-06-07 14:41:36 +0000221<dl class="dl-horizontal">
cristya4dfb122011-07-07 19:01:57 +0000222<dt>Undefined</dt>
cristy149d58c2013-08-07 19:44:54 +0000223<dd>no traits associated with this pixel channel</dd>
cristy1efc1ab2011-08-01 14:47:02 +0000224<dt>Copy</dt>
cristy149d58c2013-08-07 19:44:54 +0000225<dd>do not update this pixel channel, just copy it</dd>
cristy1efc1ab2011-08-01 14:47:02 +0000226<dt>Update</dt>
cristy149d58c2013-08-07 19:44:54 +0000227<dd>update this pixel channel</dd>
cristya4dfb122011-07-07 19:01:57 +0000228<dt>Blend</dt>
cristy149d58c2013-08-07 19:44:54 +0000229<dd>blend this pixel channel with the alpha mask if it's enabled</dd>
cristya4dfb122011-07-07 19:01:57 +0000230</dl>
231<p>We provide these methods to set and get pixel traits:</p>
cristyd2432012015-05-04 23:15:15 +0000232<pre>
cristy6e51a242015-06-07 14:41:36 +0000233GetPixelAlphaTraits() SetPixelAlphaTraits()
234GetPixelBlackTraits() SetPixelBlackTraits()
235GetPixelBlueTraits() SetPixelBlueTraits()
236GetPixelCbTraits() SetPixelCbTraits()
237GetPixelChannelTraits() SetPixelChannelTraits()
238GetPixelCrTraits() SetPixelCrTraits()
239GetPixelGrayTraits() SetPixelGrayTraits()
240GetPixelGreenTraits() SetPixelGreenTraits()
241GetPixelIndexTraits() SetPixelIndexTraits()
242GetPixelMagentaTraits() SetPixelMagentaTraits()
243GetPixelRedTraits() SetPixelRedTraits()
244GetPixelYellowTraits() SetPixelYellowTraits()
245GetPixelYTraits() SetPixelYTraits()
cristya4dfb122011-07-07 19:01:57 +0000246</pre>
cristy6e51a242015-06-07 14:41:36 +0000247<p>For convenience you can set the active trait for a set of pixel channels with a channel mask and this method:</p>
cristyd2432012015-05-04 23:15:15 +0000248<pre>
cristy6e51a242015-06-07 14:41:36 +0000249SetImageChannelMask()
cristya4dfb122011-07-07 19:01:57 +0000250</pre>
251
cristy8ee7f242013-06-20 16:08:44 +0000252<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>
cristyd2432012015-05-04 23:15:15 +0000253<pre>
254NegateImageChannel(image,channel);
cristya4dfb122011-07-07 19:01:57 +0000255</pre>
256<p>we use:</p>
cristyd2432012015-05-04 23:15:15 +0000257<pre>
cristy6e51a242015-06-07 14:41:36 +0000258channel_mask=SetImageChannelMask(image,channel);
cristyd2432012015-05-04 23:15:15 +0000259NegateImage(image,exception);
cristy6e51a242015-06-07 14:41:36 +0000260(void) SetImageChannelMask(image,channel_mask);
cristya4dfb122011-07-07 19:01:57 +0000261</pre>
262
cristy149d58c2013-08-07 19:44:54 +0000263<h4>Pixel User Channels</h4>
cristyeed6cb62012-01-28 19:38:34 +0000264<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 +0000265<h4>Pixel Metacontent</h4>
cristy6e51a242015-06-07 14:41:36 +0000266<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 (internally the data is just copied, it is not modified) and is accessed with these MagickCore API methods:</p>
cristyd2432012015-05-04 23:15:15 +0000267<pre>
268SetImageMetacontentExtent()
269GetImageMetacontentExtent()
270GetVirtualMetacontent()
271GetAuthenticMetacontent()
272GetCacheViewAuthenticMetacontent()
273GetCacheViewVirtualMetacontent()
cristy87a7f072011-07-01 00:08:52 +0000274</pre>
cristyba1758d2011-06-03 01:29:12 +0000275
cristyd2432012015-05-04 23:15:15 +0000276<h2 class="magick-header"><a id="alpha"></a>Alpha</h2>
cristy6e51a242015-06-07 14:41:36 +0000277<p>We support alpha now, previously opacity. With alpha, a value of <kbd>0</kbd> 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 <code>QuantumRange</code> 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>
cristyd2432012015-05-04 23:15:15 +0000278<h2 class="magick-header"><a id="colorspace"></a>Colorspace</h2>
cristy37b3d442015-02-28 14:00:30 +0000279<p>The <code>Rec601Luma</code> and <code>Rec709Luma</code> colorspaces are no longer supported. Instead, specify the <code>gray</code> colorspace and choose from these intensity options:</p>
cristyd2432012015-05-04 23:15:15 +0000280<pre>
cristy37b3d442015-02-28 14:00:30 +0000281Rec601Luma
282Rec601Luminance
283Rec709Luma
284Rec709Luminance
285</pre>
286<p>For example,</p>
cristyd2432012015-05-04 23:15:15 +0000287<pre>
cristy37b3d442015-02-28 14:00:30 +0000288convert myImage.png -intensity Rec709Luminance -colorspace gray myImage.jpg
289</pre>
290
cristyd2432012015-05-04 23:15:15 +0000291<h2 class="magick-header"><a id="grayscale"></a>Grayscale</h2>
cristy8ee7f242013-06-20 16:08:44 +0000292<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>
cristy8ee7f242013-06-20 16:08:44 +0000293
cristyd2432012015-05-04 23:15:15 +0000294<h2 class="magick-header"><a id="mask"></a>Masks</h2>
cristy149d58c2013-08-07 19:44:54 +0000295<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>
cristyd2432012015-05-04 23:15:15 +0000296<pre>
cristy29f2c972015-07-28 13:37:46 +0000297identify -verbose -clip statue.tif
298identify -verbose -read-mask mask.png statue.tif
cristy8ee7f242013-06-20 16:08:44 +0000299</pre>
cristyba1758d2011-06-03 01:29:12 +0000300
cristyd2432012015-05-04 23:15:15 +0000301<h2 class="magick-header"><a id="core"></a>MagickCore API</h2>
302<p>Here are a list of changes to the MagickCore API:</p>
303<ul>
304<li>Almost all image processing algorithms are now channel aware.</li>
cristy6e51a242015-06-07 14:41:36 +0000305<li>The MagickCore API adds an <code>ExceptionInfo</code> argument to those methods that lacked it in version 6, e.g. <code>NegateImage(image,MagickTrue,exception</code>);</li>
cristyd2432012015-05-04 23:15:15 +0000306<li>All method channel analogs have been removed (e.g. BlurImageChannel()), they are no longer necessary, use pixel traits instead.</li>
307<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>
308<li>The InterpolatePixelMethod enum is now PixelInterpolateMethod.</li>
309<li>The IntegerPixel storage type is removed (use LongPixel instead) and LongLongPixel is added</li>
310<li>Image signatures have changed to account for variable pixel channels.</li>
311<li>All color packet structures, PixelPacket, LongPacket, and DoublePacket, are consolidated to a single color structure, PixelInfo.</li>
312<li>The ChannelMoments structure member <code>I</code> is now <code>invariant</code>. <code>I</code> conflicts with the <code>complex.h</code> header.</li>
313<li>We added a length parameter to FormatMagickSize() to permit variable length buffers.</li>
314</ul>
cristy5b8fe762015-06-09 16:24:03 +0000315<h2 class="magick-header"><a id="core"></a>MagickWand API</h2>
316<p>Here are a list of changes to the MagickWand API:</p>
317<ul>
318<li>The DrawMatte() method is now called DrawAlpha().</li>
319<li>The MagickSetImageBias() and MagickSetImageClipMask() methods are no longer supported.</li>
320</ul>
cristyd2432012015-05-04 23:15:15 +0000321<h2 class="magick-header"><a id="headers"></a>Header Files</h2>
cristy8ee7f242013-06-20 16:08:44 +0000322<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>
cristyd2432012015-05-04 23:15:15 +0000323<pre><code>#include &lt;MagickCore/MagickCore.h&gt;
324#include &lt;MagickWand/MagickWand.h&gt;</code></pre>
cristy751980d2012-06-03 23:18:35 +0000325
cristyd2432012015-05-04 23:15:15 +0000326<h2 class="magick-header"><a id="deprecate"></a>Deprecated Features Removed</h2>
cristy8ee7f242013-06-20 16:08:44 +0000327<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 +0000328
cristyd2432012015-05-04 23:15:15 +0000329<pre>MagickCore-config
cristy91469932014-07-25 11:00:25 +0000330MagickWand-config
cristyba1758d2011-06-03 01:29:12 +0000331</pre>
cristyeed6cb62012-01-28 19:38:34 +0000332<p>The FilterImage() method has been removed. Use ConvolveImage() instead.</p>
cristyba1758d2011-06-03 01:29:12 +0000333
cristy149d58c2013-08-07 19:44:54 +0000334<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>
cristy751980d2012-06-03 23:18:35 +0000335
336
cristyd2432012015-05-04 23:15:15 +0000337<h2 class="magick-header"><a id="cli"></a>Shell API or Command-line Interface</h2>
cristy751980d2012-06-03 23:18:35 +0000338
339<p>As mentioned the primary focus of the changes to the Shell API or Command
cristyd2432012015-05-04 23:15:15 +0000340Line Interface is the abstraction so that not only can <var>options</var> be read
cristy751980d2012-06-03 23:18:35 +0000341from command line arguments, but also from a file (script) or from a file
342stream (interactive commands, or co-processing). </p>
343
344<p>To do this the CLI parser needed to be re-written, so as to always perform
345all options, in a strict, do-it-as-you-see it order. Previously in IMv6
346options were performed in groups (known as 'FireOptions), this awkwardness is
cristy37b3d442015-02-28 14:00:30 +0000347now gone. However the strict order means that you can no longer give operations
cristy751980d2012-06-03 23:18:35 +0000348before providing an image for the operations to work on. To do so will now
349produce an error. </p>
350
351<p>Error reporting is now reporting exactly which option (by argument count on
352command line, or line,column in scripts) caused the 'exception'. This is not
353complete as yet but getting better. Also not complete is 'regard-warnings'
354handling or its replacement, which will allow you to ignore reported errors
355and continue processing (as appropriate due to error) in co-processes or
356interactive usage. </p>
357
358<p>The parenthesis options used to 'push' the current image list, and image
cristy8ee7f242013-06-20 16:08:44 +0000359settings (EG: '<code>(</code>' and '<code>)</code>' ) on to a stack now has
cristy91469932014-07-25 11:00:25 +0000360a completely separate image settings stack. That is parenthesis 'push/pull'
cristy8ee7f242013-06-20 16:08:44 +0000361image lists, and curly braces (EG: '<code>{</code>' and '<code>}</code>' ) will
cristy751980d2012-06-03 23:18:35 +0000362'push/pull' image settings. </p>
363
364<p>Of course due to the previously reported changes to the underlying channel
365handling will result be many side effects to almost all options. Here are some
366specific </p>
367
368<p>Most algorithms update the red, green, blue, black (for CMYK), and alpha
369channels. Most operators will blend alpha the other color channels, but other
370operators (and situations) may require this blending to be disabled, and is
371currently done by removing alpha from teh active channels via
cristy8ee7f242013-06-20 16:08:44 +0000372<code>-channel</code> option. (e.g. <code>convert castle.gif -channel RGB
373-negate castle.png</code>). </p>
cristy751980d2012-06-03 23:18:35 +0000374
cristy37b3d442015-02-28 14:00:30 +0000375<p>Reading gray-scale images generate an image with only one channel. If
cristy8ee7f242013-06-20 16:08:44 +0000376that image is to then accept color the <code>-colorspace</code> setting needs to
cristy751980d2012-06-03 23:18:35 +0000377be applied to expand the one channel into separate RGB (or other) channels.
378</p>
cristyd2432012015-05-04 23:15:15 +0000379<p>Previously, command-line arguments were limited to 4096 characters, with ImageMagick version 7 the limit has increased to 131072 characters.</p>
cristy751980d2012-06-03 23:18:35 +0000380
381<h3>Command Changes</h3>
cristyd2432012015-05-04 23:15:15 +0000382<p>Here are a list of changes to the ImageMagick commands:</p>
383<dl class="dl-horizontal">
cristy751980d2012-06-03 23:18:35 +0000384<dt>magick</dt>
cristy8ee7f242013-06-20 16:08:44 +0000385<dd>The "<code>magick</code>" command is the new primary command of the Shell
386 API, replacing the old "<code>convert</code>" command. This allows you to
387 create a 'magick script' of the form "<code>#!/path/to/command/magick
388 -script</code>", or pipe options into a command "<code>magick -script
389 -</code>, as abackground process. </dd>
cristy751980d2012-06-03 23:18:35 +0000390
391<dt>magick-script</dt>
cristy8ee7f242013-06-20 16:08:44 +0000392<dd>This the same as "<code>magick</code>", (only command name is different)
393 but which has an implict "<code>-script</code>" option. This allows you to
394 use it in an "<code>env</code>" style script form. That is a magick script
395 starts with the 'she-bang' line of "<code>#!/usr/bin/env
396 magick-script</code>" allowing the script interpreter to be found anywhere
397 on the users command "<code>PATH</code>". This is required to get around
cristy751980d2012-06-03 23:18:35 +0000398 a "one argument she-bang bug" that is common on most UNIX systems
399 (including Linux, but not MacOSX).</dd>
400
401</dl>
402
cristy37b3d442015-02-28 14:00:30 +0000403<h3>Behavioral Changes</h3>
404<p>Image settings are applied to each image on the command line. To associate a setting with a particular image, use parenthesis to remove ambiguity. In this example we assign a unique page offset to each image:</p>
cristyd2432012015-05-04 23:15:15 +0000405<pre>
cristy37b3d442015-02-28 14:00:30 +0000406convert \( -page +10+20 first.png \) \( -page +100+200 second.png \) ...
407</pre>
408
409<p>By default, image operations such as convolution blends alpha with each channel. To convolve each channel independently, deactivate the alpha channel as follows:</p>
cristyd2432012015-05-04 23:15:15 +0000410<pre>
cristy37b3d442015-02-28 14:00:30 +0000411convert ... -alpha discrete -blur 0x1 ...
412</pre>
413<p>To just copy the alpha values, use <code>-alpha off</code>.</p>
cristy8ee7f242013-06-20 16:08:44 +0000414<p>Some options have changed in ImageMagick version 7. These include:</p>
415<dl>
cristy37b3d442015-02-28 14:00:30 +0000416<dt>+combine</dt>
417<dd>This option now requires an argument, the image colorspace (e.g. +combine sRGB).</dd>
cristy8ee7f242013-06-20 16:08:44 +0000418</dl>
419
cristy751980d2012-06-03 23:18:35 +0000420<h3>New Options</h3>
421<p>ImageMagick version 7 supports these new options, though most are limited
cristy8ee7f242013-06-20 16:08:44 +0000422to the "<code>magick</code>" command, or to use in "<code>magick</code>"
cristy751980d2012-06-03 23:18:35 +0000423scripts.</p>
424
cristyd2432012015-05-04 23:15:15 +0000425<dl class="dl-horizontal">
cristy751980d2012-06-03 23:18:35 +0000426<dt>{ ... }</dt>
427<dd>Save (and restore) the current image settings (internally known as the
428 "image_info" structure). This is automatically done with parenthesis (EG:
cristy8ee7f242013-06-20 16:08:44 +0000429 '<code>(</code>' and '<code>)</code>') is "<code>-regard-parenthesis</code>" has
cristy751980d2012-06-03 23:18:35 +0000430 been set, just as in IMv6. Caution is advised to prevent un-balanced
cristy149d58c2013-08-07 19:44:54 +0000431 braces errors.</dd>
cristy751980d2012-06-03 23:18:35 +0000432
433<dt>--</dt>
cristy8ee7f242013-06-20 16:08:44 +0000434<dd>End of options, to be used in IMv7 "<code>mogrify</code>" command to
cristy37b3d442015-02-28 14:00:30 +0000435 explicitly separate the operations to be applied and the images that
cristy751980d2012-06-03 23:18:35 +0000436 are to be processed 'in-place'. (not yet implemented). However if
cristy8ee7f242013-06-20 16:08:44 +0000437 not provided, "<code>-read</code>" can still be used to differentiate
cristy751980d2012-06-03 23:18:35 +0000438 secondary image reads (for use in things like alpha composition) from
439 the 'in-place' image being processed. </dd>
440
cristy37b3d442015-02-28 14:00:30 +0000441<dd>In other commands (such as "magick") it is equivalent to a explicit
cristy8ee7f242013-06-20 16:08:44 +0000442 "<code>-read</code>" (see below) of the next option as a image (as it was in
cristy751980d2012-06-03 23:18:35 +0000443 IMv6). </dd>
444
cristy29f2c972015-07-28 13:37:46 +0000445<dt>-alpha discrete</dt>
cristyd2432012015-05-04 23:15:15 +0000446<dd>treat the alpha channel independently (do not blend).</dd>
447
448<dt>-channel-fx <var>expression</var> </dt>
cristy751980d2012-06-03 23:18:35 +0000449<dd>
450<p>exchange, extract, or copy one or more image channels.</p>
451
cristy8ee7f242013-06-20 16:08:44 +0000452<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 +0000453
cristyd2432012015-05-04 23:15:15 +0000454<pre>
cristy6e51a242015-06-07 14:41:36 +0000455&lt;=&gt; exchange two channels (e.g. red&lt;=&gt;blue)
456=&gt; copy one channel to another channel (e.g. red=&gt;green)
457= assign a constant value to a channel (e.g. red=50%)
458, write new image with channels in the specified order (e.g. red, green)
459; add a new output image for the next set of channel operations (e.g. red; green; blue)
460| move to the next input image for the source of channel data (e.g. | gray=&gt;alpha)
cristy751980d2012-06-03 23:18:35 +0000461</pre>
462
463<p>For example, to create 3 grayscale images from the red, green, and blue channels of an image, use:</p>
464
cristyd2432012015-05-04 23:15:15 +0000465<pre>
466-channel-fx "red; green; blue"
cristy751980d2012-06-03 23:18:35 +0000467</pre>
468
469<p>A channel without an operation symbol implies separate (i.e, semicolon).</p>
470
cristy8ee7f242013-06-20 16:08:44 +0000471<p>Here we take an sRGB image and a grayscale image and inject the grayscale image into the alpha channel:</p>
cristyd2432012015-05-04 23:15:15 +0000472<pre>
473convert wizard.png mask.pgm -channel-fx '| gray=&gt;alpha' wizard-alpha.png
cristy8ee7f242013-06-20 16:08:44 +0000474</pre>
475<p>Use a similar command to define a read mask:</p>
cristyd2432012015-05-04 23:15:15 +0000476<pre>
477convert wizard.png mask.pgm -channel-fx '| gray=&gt;read-mask' wizard-mask.png
cristy8ee7f242013-06-20 16:08:44 +0000478</pre>
479
480<p>Add <code>-debug pixel</code> prior to the <code>-channel-fx</code> option to track the channel morphology.</p>
481
cristy751980d2012-06-03 23:18:35 +0000482</dd>
483
484<dt>-exit</dt>
485<dd>Stop processing at this point. No further options will be processed after
cristy8ee7f242013-06-20 16:08:44 +0000486 this option. Can be used in a script to force the "<code>magick</code>"
cristy751980d2012-06-03 23:18:35 +0000487 command to exit, without actually closing the pipeline that it is
488 processing options from. </dd>
489
cristy8ee7f242013-06-20 16:08:44 +0000490<dd>May also be used as a 'final' option on the "<code>magick</code>" command
cristy751980d2012-06-03 23:18:35 +0000491 line, instead of a implicit output image, to completely prevent any image
cristy8ee7f242013-06-20 16:08:44 +0000492 write. ASIDE: even the "<code>NULL:</code>" coder requires at least one
cristy751980d2012-06-03 23:18:35 +0000493 image, for it to 'not write'! This option does not require any images at
494 all. </dd>
495
496<dt>-read {image}</dt>
497<dd>Explicit read of an image, rather than an implicit read. This allows you
498 to read from filenames that start with an 'option' character, and which
499 otherwise could be mistaken as an option (unknown or otherwise). This will
cristy8ee7f242013-06-20 16:08:44 +0000500 eventually be used in "<code>mogrify</code>" to allow the reading of
cristy751980d2012-06-03 23:18:35 +0000501 secondary images, and allow the use of image list operations within that
502 command. </dd>
503
cristy29f2c972015-07-28 13:37:46 +0000504<dt>-read-mask</dt>
505<dd>prevent updates to image pixels specified by the mask</dd>
506
cristy751980d2012-06-03 23:18:35 +0000507<dt>-region</dt>
cristy8ee7f242013-06-20 16:08:44 +0000508<dd>not yet implemented in "<code>magick</code>". (very soon)</dd>
cristy751980d2012-06-03 23:18:35 +0000509
510<dt>-script {file}</dt>
cristy8ee7f242013-06-20 16:08:44 +0000511<dd>In "<code>magick</code>", stop the processing of command line arguments as
cristy751980d2012-06-03 23:18:35 +0000512 image operations, and read all further options from the given file or
513 pipeline.</dd>
cristy29f2c972015-07-28 13:37:46 +0000514<dt>-write-mask</dt>
515<dd>prevent pixels from being written.</dd>
cristy751980d2012-06-03 23:18:35 +0000516
517</dl>
518
519<h3>Changed Options</h3>
520<p>These options are known to have changed, in some way.</p>
cristyd2432012015-05-04 23:15:15 +0000521<dl class="dl-horizontal">
522<dt>-bias</dt>
523<dd>The option is no longer recognized. Use <code>-define convolve:bias=<var>value</var></code> instead.</dd>
524<dt>-draw</dt>
525<dd>The <code>matte</code> primitive is now <code>alpha</code> (e.g. <code>-draw 'alpha 0,0 floodfill'</code>).</dd>
cristy751980d2012-06-03 23:18:35 +0000526<dt>-negate</dt>
527<dd>currently negates all channels, including alpha if present. As such you
528 may need to use the -channel option to prevent alpha negation. </dd>
cristy751980d2012-06-03 23:18:35 +0000529</dl>
530
cristy8ee7f242013-06-20 16:08:44 +0000531<h3>Deprecated warning given, but will work (for now)</h3>
cristyd2432012015-05-04 23:15:15 +0000532<dl class="dl-horizontal">
cristy751980d2012-06-03 23:18:35 +0000533<dt>-affine</dt>
cristy8ee7f242013-06-20 16:08:44 +0000534<dd>Replaced by <code>-draw "affine ..."</code>. (see transform)</dd>
cristy751980d2012-06-03 23:18:35 +0000535<dt>-average</dt>
cristy8ee7f242013-06-20 16:08:44 +0000536<dd>Replaced by <code>-evaluate-sequence Mean</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000537<dt>-box</dt>
cristy8ee7f242013-06-20 16:08:44 +0000538<dd>Replaced by <code>-undercolor</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000539<dt>-deconstruct</dt>
cristy8ee7f242013-06-20 16:08:44 +0000540<dd>Replaced by <code>-layers CompareAny</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000541<dt>-gaussian</dt>
cristy8ee7f242013-06-20 16:08:44 +0000542<dd>Replaced by <code>-gaussian-blur</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000543<dt>-/+map</dt>
cristy8ee7f242013-06-20 16:08:44 +0000544<dd>Replaced by <code>-/+remap</code>.</dd>
cristy29f2c972015-07-28 13:37:46 +0000545<dt>-/+mask</dt>
546<dd>Replaced by <code>-/+read-mask</code>, <code>-/+write-mask</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000547<dt>-/+matte</dt>
cristy8ee7f242013-06-20 16:08:44 +0000548<dd>Replaced by <code>-alpha Set/Off</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000549<dt>-transform</dt>
cristy8ee7f242013-06-20 16:08:44 +0000550<dd>Replaced by <code>-distort Affine "..."</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000551</dl>
552
cristy8ee7f242013-06-20 16:08:44 +0000553<h3>Deprecated warning given, and ignored (for now)</h3>
cristy751980d2012-06-03 23:18:35 +0000554<p>Almost 'plus' (+) option that did not do anything has been marked as
cristy8ee7f242013-06-20 16:08:44 +0000555deprecated, and does nothing. It does not even have associated code. For
cristy751980d2012-06-03 23:18:35 +0000556example "+annotate", "+resize", "+clut", and "+draw" .</p>
557
cristyd2432012015-05-04 23:15:15 +0000558<dl class="dl-horizontal">
cristy751980d2012-06-03 23:18:35 +0000559<dt>-affinity</dt>
cristy37b3d442015-02-28 14:00:30 +0000560<dd>Replaced by <code>-remap</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000561<dt>-maximum</dt>
cristy8ee7f242013-06-20 16:08:44 +0000562<dd>Replaced by <code>-evaluate-sequence Max</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000563<dt>-median</dt>
cristy8ee7f242013-06-20 16:08:44 +0000564<dd>Replaced by <code>-evaluate-sequence Median</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000565<dt>-minimum</dt>
cristy8ee7f242013-06-20 16:08:44 +0000566<dd>Replaced by <code>-evaluate-sequence Min</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000567<dt>-recolor</dt>
cristy149d58c2013-08-07 19:44:54 +0000568<dd>Replaced by <code>-color-matrix</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000569</dl>
570
571<h3>Removed / Replaced Options ("no such option" error and abort)</h3>
572
cristyd2432012015-05-04 23:15:15 +0000573<dl class="dl-horizontal">
cristy751980d2012-06-03 23:18:35 +0000574<dt>-origin</dt>
575<dd>old option, unknown meaning.</dd>
576<dt>-pen</dt>
cristy149d58c2013-08-07 19:44:54 +0000577<dd>Replaced by <code>-fill</code>.</dd>
cristy751980d2012-06-03 23:18:35 +0000578<dt>-passphrase</dt>
579<dd>old option, unknown meaning</dd>
580</dl>
cristyd2432012015-05-04 23:15:15 +0000581<h2 class="magick-header"><a id="summary"></a>Version 7 Change Summary</h2>
cristye6e84152011-06-06 14:16:49 +0000582<p>Changes from ImageMagick version 6 to version 7 are summarized here:</p>
cristy8ee7f242013-06-20 16:08:44 +0000583<h4>High Dynamic Range Imaging</h4>
cristyd2432012015-05-04 23:15:15 +0000584<ul>
cristy8ee7f242013-06-20 16:08:44 +0000585<li>ImageMagick version 7 enables HDRI by default. Expect more accurate image processing results with higher memory requirement and possible slower processing times.</li>
cristyd2432012015-05-04 23:15:15 +0000586</ul>
cristy8ee7f242013-06-20 16:08:44 +0000587<h4>Pixels</h4>
cristyd2432012015-05-04 23:15:15 +0000588<ul>
cristy1efc1ab2011-08-01 14:47:02 +0000589<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>
590<li>Use convenience macros to access pixel channels (e.g. GetPixelRed(), SetPixelRed()).</li>
cristy8ee7f242013-06-20 16:08:44 +0000591<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>
592<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 +0000593<li>Use GetPixelChannels() to advance to the next set of pixel channels.</li>
cristyd2432012015-05-04 23:15:15 +0000594<li>Use the <var>metacontent</var> channel to associate metacontent with each pixel.</li>
cristyeed6cb62012-01-28 19:38:34 +0000595<li>All color packet structures, PixelPacket, LongPacket, and DoublePacket, are consolidated to a single color structure, PixelInfo.</li>
cristyd2432012015-05-04 23:15:15 +0000596</ul>
cristy8ee7f242013-06-20 16:08:44 +0000597<h4>Alpha</h4>
cristyd2432012015-05-04 23:15:15 +0000598<ul>
cristyba1758d2011-06-03 01:29:12 +0000599<li>We support alpha rather than opacity (0 transparent; QuantumRange opaque).</li>
cristy1efc1ab2011-08-01 14:47:02 +0000600<li>Use GetPixelAlpha() or SetPixelAlpha() to get or set the alpha pixel channel value.</li>
cristyd2432012015-05-04 23:15:15 +0000601</ul>
cristy8ee7f242013-06-20 16:08:44 +0000602<h4>Grayscale</h4>
cristyd2432012015-05-04 23:15:15 +0000603<ul>
cristy6e51a242015-06-07 14:41:36 +0000604<li>Grayscale images consume one pixel channel in ImageMagick version 7. To process RGB, set the colorspace to RGB (e.g. -colorspace sRGB).</li>
cristyd2432012015-05-04 23:15:15 +0000605</ul>
cristy29f2c972015-07-28 13:37:46 +0000606<h4>Masks</h4>
607<ul>
608<li>ImageMagick version 6 only supports read mask in limited circumstances. Version 7 supports both a read and write mask. The read mask is honored by most image-processing algorithms.</li>
609</ul>
cristy8ee7f242013-06-20 16:08:44 +0000610<h4>MagickCore API</h4>
cristyd2432012015-05-04 23:15:15 +0000611<ul>
cristyeed6cb62012-01-28 19:38:34 +0000612<li>Almost all image processing algorithms are now channel aware.</li>
cristy6e51a242015-06-07 14:41:36 +0000613<li>MagickCore, version 7, adds an ExceptionInfo argument to those methods that lacked it in version 6, e.g. <code>NegateImage(image,MagickTrue,exception);</code></li>
cristy1efc1ab2011-08-01 14:47:02 +0000614<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 +0000615<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>
616<li>The InterpolatePixelMethod enum is now PixelInterpolateMethod.</li>
617<li>To account for variable pixel channels, images may now return a different signature.</li>
cristyd2432012015-05-04 23:15:15 +0000618</ul>
cristy8ee7f242013-06-20 16:08:44 +0000619<h4>Deprecated Methods</h4>
cristyd2432012015-05-04 23:15:15 +0000620<ul>
cristy2dcd6822011-06-13 16:21:20 +0000621<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 +0000622<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 +0000623<li>The FilterImage() method has been removed. Use ConvolveImage() instead.</li>
cristyd2432012015-05-04 23:15:15 +0000624</ul>
cristyba1758d2011-06-03 01:29:12 +0000625</div>
cristyd2432012015-05-04 23:15:15 +0000626 <footer class="magick-footer">
cristy29f2c972015-07-28 13:37:46 +0000627 <p><a href="support.html">Donate</a>
628 <a href="sitemap.html">Sitemap</a>
cristyd2432012015-05-04 23:15:15 +0000629 <a href="links.html">Related</a>
cristy29f2c972015-07-28 13:37:46 +0000630 <a href="architecture.html">Architecture</a>
cristyd2432012015-05-04 23:15:15 +0000631</p>
632 <p><a href="porting.html#">Back to top</a>
cristyea2793e2015-05-31 16:52:26 +0000633 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
cristy5b8fe762015-06-09 16:24:03 +0000634 <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
cristya1890f02015-05-15 23:32:44 +0000635 <p><small>© 1999-2015 ImageMagick Studio LLC</small></p>
cristyd2432012015-05-04 23:15:15 +0000636 </footer>
637</div><!-- /.container -->
cristy751980d2012-06-03 23:18:35 +0000638
cristyd2432012015-05-04 23:15:15 +0000639 <script src="https://localhost/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
cristy29f2c972015-07-28 13:37:46 +0000640 <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
cristyad41c0c2012-10-31 00:49:28 +0000641</div>
cristyad41c0c2012-10-31 00:49:28 +0000642</body>
cristy5a367e42015-05-05 12:39:18 +0000643</html>