blob: 4c151aaaab3f52cb1c461568e4a3bd9026cb8f2c [file] [log] [blame]
cristy06f63f22012-10-31 00:50:07 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html version="-//W3C//DTD XHTML 1.1//EN"
4 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xsi:schemaLocation="http://www.w3.org/1999/xhtml
7 http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
8<head>
9 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
cristy8ee7f242013-06-20 16:08:44 +000010 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"/>
cristyffb69ed2010-12-25 00:06:48 +000011 <title>ImageMagick: MagickCore, C API for ImageMagick: Dealing with Image Layers</title>
cristy751980d2012-06-03 23:18:35 +000012 <meta http-equiv="content-language" content="en-US"/>
13 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
14 <meta http-equiv="reply-to" content="magick-users@imagemagick.org"/>
15 <meta name="application-name" content="ImageMagick"/>
cristy8ee7f242013-06-20 16:08:44 +000016 <meta name="description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition, resize, rotate, shear, distort or transform images automagically."/>
cristy751980d2012-06-03 23:18:35 +000017 <meta name="application-url" content="http://www.imagemagick.org"/>
18 <meta name="generator" content="PHP"/>
cristy8ee7f242013-06-20 16:08:44 +000019 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, dealing, with, image, layers, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"/>
cristy751980d2012-06-03 23:18:35 +000020 <meta name="rating" content="GENERAL"/>
21 <meta name="robots" content="INDEX, FOLLOW"/>
22 <meta name="generator" content="ImageMagick Studio LLC"/>
23 <meta name="author" content="ImageMagick Studio LLC"/>
24 <meta name="revisit-after" content="2 DAYS"/>
25 <meta name="resource-type" content="document"/>
cristy72da67d2013-02-24 21:40:48 +000026 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"/>
cristy751980d2012-06-03 23:18:35 +000027 <meta name="distribution" content="Global"/>
cristy72da67d2013-02-24 21:40:48 +000028 <link rel="icon" href="../../images/wand.png"/>
29 <link rel="shortcut icon" href="../../images/wand.ico" type="images/x-icon"/>
cristy06f63f22012-10-31 00:50:07 +000030 <link rel="canonical" href="http://www.imagemagick.org" />
31 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
cristy8ee7f242013-06-20 16:08:44 +000032
33 <!-- Add jQuery library -->
34 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
35
36 <!-- Add mousewheel plugin (this is optional) -->
37 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
38
39 <!-- Add fancyBox -->
40 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen" />
41 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.0.6"></script>
42
43 <!-- Optionally add helpers - button, thumbnail and/or media -->
44 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" type="text/css" media="screen" />
45 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>
46 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.0"></script>
47
48 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.6" type="text/css" media="screen" />
49 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.6"></script>
50
cristy72da67d2013-02-24 21:40:48 +000051 <script type="text/javascript">
cristy8ee7f242013-06-20 16:08:44 +000052 $(document).ready(function() {
53 $(".fancybox").fancybox();
54 });
cristy72da67d2013-02-24 21:40:48 +000055 </script>
cristy8ee7f242013-06-20 16:08:44 +000056
57 <!-- ImageMagick style -->
58 <style type="text/css" media="all">
59 @import url("../../www/magick.css");
60 </style>
cristy06f63f22012-10-31 00:50:07 +000061</head>
62
63<body id="www-imagemagick-org">
cristy8ee7f242013-06-20 16:08:44 +000064
65<script>
66 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
67 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
68 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
69 })(window,document,'offline-script','//127.0.0.1/analytics.js','ga');
70
71 ga('create', 'UA-40133312-1', 'imagemagick.org');
72 ga('send', 'pageview');
73</script>
74
cristy06f63f22012-10-31 00:50:07 +000075<div class="titlebar">
76<div style="margin: 17px auto; float: left;">
77 <script type="text/javascript">
78 <!--
79 google_ad_client = "pub-3129977114552745";
80 google_ad_slot = "5439289906";
81 google_ad_width = 728;
82 google_ad_height = 90;
83 //-->
84 </script>
85 <script type="text/javascript"
cristy8ee7f242013-06-20 16:08:44 +000086 src="http://127.0.0.1/pagead/show_ads.js">
cristy06f63f22012-10-31 00:50:07 +000087 </script>
88</div>
cristy8ee7f242013-06-20 16:08:44 +000089<a href="http://www.imagemagick.org/discourse-server/">
cristy72da67d2013-02-24 21:40:48 +000090 <img src="../../images/logo.jpg"
cristy06f63f22012-10-31 00:50:07 +000091 alt="ImageMagick Logo"
92 style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
cristy8ee7f242013-06-20 16:08:44 +000093<a href="../../index.html">
cristy72da67d2013-02-24 21:40:48 +000094 <img src="../../images/sprite.jpg"
cristy06f63f22012-10-31 00:50:07 +000095 alt="ImageMagick Sprite"
96 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
97</div>
98
99<div class="westbar">
100
cristy3ed852e2009-09-05 21:47:34 +0000101<div class="menu">
cristy8ee7f242013-06-20 16:08:44 +0000102 <a title="About ImageMagick" href="../../index.html">About ImageMagick</a>
cristy3ed852e2009-09-05 21:47:34 +0000103</div>
cristy3ed852e2009-09-05 21:47:34 +0000104<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000105 <a title="Binary Releases" href="../../www/binary-releases.html">Binary Releases</a>
cristybb503372010-05-27 20:51:26 +0000106</div>
107<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000108 <a title="Binary Release: Unix" href="../../www/binary-releases.html#unix">Unix</a>
cristybb503372010-05-27 20:51:26 +0000109</div>
110<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000111 <a title="Binary Release: MacOS X" href="../../www/binary-releases.html#macosx">Mac OS X</a>
cristybb503372010-05-27 20:51:26 +0000112</div>
113<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000114 <a title="Binary Release: iOS" href="../../www/binary-releases.html#iOS">iOS</a>
cristyda16f162011-02-19 23:52:17 +0000115</div>
116<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000117 <a title="Binary Release: Windows" href="../../www/binary-releases.html#windows">Windows</a>
cristybb503372010-05-27 20:51:26 +0000118</div>
cristy06f63f22012-10-31 00:50:07 +0000119<div class="sep"></div>
cristybb503372010-05-27 20:51:26 +0000120<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000121 <a title="Command-line Tools" href="../../www/command-line-tools.html">Command-line Tools</a>
cristy3ed852e2009-09-05 21:47:34 +0000122</div>
123<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000124 <a title="Command-line Tools: Processing" href="../../www/command-line-processing.html">Processing</a>
cristy3ed852e2009-09-05 21:47:34 +0000125</div>
126<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000127 <a title="Command-line Tools: Options" href="../../www/command-line-options.html">Options</a>
cristy3ed852e2009-09-05 21:47:34 +0000128</div>
129<div class="sub">
cristy83a272e2010-05-07 20:40:35 +0000130 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
cristy3ed852e2009-09-05 21:47:34 +0000131</div>
132<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000133 <a title="Program Interfaces" href="../../www/api.html">Program Interfaces</a>
cristy3ed852e2009-09-05 21:47:34 +0000134</div>
135<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000136 <a title="Program Interface: MagickWand" href="../../www/magick-wand.html">MagickWand</a>
cristy3ed852e2009-09-05 21:47:34 +0000137</div>
138<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000139 <a title="Program Interface: MagickCore" href="../../www/magick-core.html">MagickCore</a>
cristy3ed852e2009-09-05 21:47:34 +0000140</div>
141<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000142 <a title="Program Interface: PerlMagick" href="../../www/perl-magick.html">PerlMagick</a>
cristy3ed852e2009-09-05 21:47:34 +0000143</div>
144<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000145 <a title="Program Interface: Magick++" href="../../www/magick++.html">Magick++</a>
cristy3ed852e2009-09-05 21:47:34 +0000146</div>
cristy06f63f22012-10-31 00:50:07 +0000147<div class="sep"></div>
cristy3ed852e2009-09-05 21:47:34 +0000148<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000149 <a title="Install from Source" href="../../www/install-source.html">Install from Source</a>
cristy3ed852e2009-09-05 21:47:34 +0000150</div>
151<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000152 <a title="Install from Source: Unix" href="../../www/install-source.html#unix">Unix</a>
cristy3ed852e2009-09-05 21:47:34 +0000153</div>
154<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000155 <a title="Install from Source: Windows" href="../../www/install-source.html#windows">Windows</a>
cristy3ed852e2009-09-05 21:47:34 +0000156 </div>
157<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000158 <a title="Resources" href="../../www/resources.html">Resources</a>
cristy3ed852e2009-09-05 21:47:34 +0000159</div>
cristybb503372010-05-27 20:51:26 +0000160<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000161 <a title="Architecture" href="../../www/architecture.html">Architecture</a>
cristybb503372010-05-27 20:51:26 +0000162</div>
cristy3ed852e2009-09-05 21:47:34 +0000163<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000164 <a title="Download" href="../../www/download.html">Download</a>
cristy3ed852e2009-09-05 21:47:34 +0000165</div>
cristy06f63f22012-10-31 00:50:07 +0000166<div class="sep"></div>
cristy3ed852e2009-09-05 21:47:34 +0000167<div class="menu">
cristy3dfa2192013-02-24 22:46:05 +0000168 <a title="Search" href="http://www.imagemagick.org/script/search.php">Search</a>
cristy3ed852e2009-09-05 21:47:34 +0000169</div>
cristy06f63f22012-10-31 00:50:07 +0000170<div class="sep"></div>
cristy3ed852e2009-09-05 21:47:34 +0000171<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000172 <a title="Site Map" href="../../www/sitemap.html">Site Map</a>
cristy3ed852e2009-09-05 21:47:34 +0000173</div>
174<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000175 <a title="Site Map: Links" href="../../www/links.html">Links</a>
cristy3ed852e2009-09-05 21:47:34 +0000176</div>
cristy06f63f22012-10-31 00:50:07 +0000177<div class="sep"></div>
cristy8ee7f242013-06-20 16:08:44 +0000178<div class="menu">
179 <a title="Support ImageMagick Development" href="../../www/support.html">Support ImageMagick Development</a>
cristy3ed852e2009-09-05 21:47:34 +0000180</div>
cristy06f63f22012-10-31 00:50:07 +0000181</div>
182
183<div class="eastbar">
cristy06f63f22012-10-31 00:50:07 +0000184 <script type="text/javascript">
cristy8ee7f242013-06-20 16:08:44 +0000185 /* <![CDATA[ */
cristy06f63f22012-10-31 00:50:07 +0000186 (function() {
cristy8ee7f242013-06-20 16:08:44 +0000187 var po = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
188 po.type = 'text/javascript';
189 po.async = true;
190 po.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
191 var script = document.getElementsByTagName('offline-script')[0];
192 script.parentNode.insertBefore(po, script);
cristy06f63f22012-10-31 00:50:07 +0000193 })();
cristy8ee7f242013-06-20 16:08:44 +0000194 /* ]]> */
cristy06f63f22012-10-31 00:50:07 +0000195 </script>
cristy8ee7f242013-06-20 16:08:44 +0000196 <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
197 <noscript>
198 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
199 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0" /></a>
200 </noscript>
201 <div class="g-plusone" id="gplusone"></div>
202 <script type="text/javascript">
203 /* <![CDATA[ */
204 window.___gcfg = {
205 lang: 'en-US'
206 };
207
208 (function() {
209 var po = document.createElement('offline-script');
210 po.type = 'text/javascript';
211 po.async = true;
212 po.src = 'https://127.0.0.1/js/plusone.js';
213 var script = document.getElementsByTagName('offline-script')[0];
214 script.parentNode.insertBefore(po, script);
215 })();
216 var gplusone = document.getElementById("gplusone");
217 gplusone.setAttribute("data-size","medium");
218 gplusone.setAttribute("data-count","true");
219 /* ]]> */
220 </script>
cristy06f63f22012-10-31 00:50:07 +0000221</div>
222
223<div class="main">
224
cristy20398432011-08-11 01:31:50 +0000225<h1>Module layer Methods</h1>
cristydba8f1d2013-07-28 13:49:24 +0000226<p class="navigation-index">[<a href="layer.html#CoalesceImages">CoalesceImages</a> &#8226; <a href="layer.html#DisposeImages">DisposeImages</a> &#8226; <a href="layer.html#CompareImageLayers">CompareImageLayers</a> &#8226; <a href="layer.html#DeconstructImages">DeconstructImages</a> &#8226; <a href="layer.html#OptimizeImageLayers">OptimizeImageLayers</a> &#8226; <a href="layer.html#OptimizeImagePlusLayers">OptimizeImagePlusLayers</a> &#8226; <a href="layer.html#OptimizeImageTransparency">OptimizeImageTransparency</a> &#8226; <a href="layer.html#RemoveDuplicateLayers">RemoveDuplicateLayers</a> &#8226; <a href="layer.html#RemoveZeroDelayLayers">RemoveZeroDelayLayers</a> &#8226; <a href="layer.html#CompositeLayers">CompositeLayers</a> &#8226; <a href="layer.html#MergeImageLayers">MergeImageLayers</a>]</p>
cristy6f77f692011-02-15 15:31:39 +0000227
cristy20398432011-08-11 01:31:50 +0000228<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="CoalesceImages">CoalesceImages</a></h2>
229<div class="doc-section">
230
231<p>CoalesceImages() composites a set of images while respecting any page offsets and disposal methods. GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. A new image sequence is returned with all images the same size as the first images virtual canvas and composited with the next image in the sequence.</p>
232
233<p>The format of the CoalesceImages method is:</p>
234
235<pre class="code">
236 Image *CoalesceImages(Image *image,ExceptionInfo *exception)
237</pre>
238
239<p>A description of each parameter follows:</p>
240
241<h5>image</h5>
242<p>the image sequence.</p>
243
244<h5>exception</h5>
245<p>return any errors or warnings in this structure.</p>
246
247 </div>
248<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="DisposeImages">DisposeImages</a></h2>
249<div class="doc-section">
250
251<p>DisposeImages() returns the coalesced frames of a GIF animation as it would appear after the GIF dispose method of that frame has been applied. That is it returned the appearance of each frame before the next is overlaid.</p>
252
253<p>The format of the DisposeImages method is:</p>
254
255<pre class="code">
cristy8ee7f242013-06-20 16:08:44 +0000256 Image *DisposeImages(Image *images,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000257</pre>
258
259<p>A description of each parameter follows:</p>
260
261<h5>image</h5>
262<p>the image sequence.</p>
263
264<h5>exception</h5>
265<p>return any errors or warnings in this structure.</p>
266
267 </div>
268<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="CompareImageLayers">CompareImageLayers</a></h2>
269<div class="doc-section">
270
cristy72da67d2013-02-24 21:40:48 +0000271<p>CompareImageLayers() compares each image with the next in a sequence and returns the minimum bounding region of all the pixel differences (of the ImageLayerMethod specified) it discovers.</p>
cristy20398432011-08-11 01:31:50 +0000272
273<p>Images do NOT have to be the same size, though it is best that all the images are 'coalesced' (images are all the same size, on a flattened canvas, so as to represent exactly how an specific frame should look).</p>
274
275<p>No GIF dispose methods are applied, so GIF animations must be coalesced before applying this image operator to find differences to them.</p>
276
277<p>The format of the CompareImageLayers method is:</p>
278
279<pre class="code">
280 Image *CompareImageLayers(const Image *images,
cristy72da67d2013-02-24 21:40:48 +0000281 const ImageLayerMethod method,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000282</pre>
283
284<p>A description of each parameter follows:</p>
285
286<h5>image</h5>
287<p>the image.</p>
288
289<h5>method</h5>
290<p>the layers type to compare images with. Must be one of... CompareAnyLayer, CompareClearLayer, CompareOverlayLayer.</p>
291
292<h5>exception</h5>
293<p>return any errors or warnings in this structure.</p>
294
295 </div>
296<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="DeconstructImages">DeconstructImages</a></h2>
297<div class="doc-section">
298
299<p>DeconstructImages() compares each image with the next in a sequence and returns the minimum bounding region of all differences from the first image.</p>
300
301<p>This function is deprecated in favor of the more universal CompareImageLayers() function.</p>
302
303<p>The format of the DeconstructImages method is:</p>
304
305<pre class="code">
306 Image *DeconstructImages(const Image *images, ExceptionInfo *exception)
307</pre>
308
309<p>A description of each parameter follows:</p>
310
311<h5>image</h5>
312<p>the image.</p>
313
314<h5>exception</h5>
315<p>return any errors or warnings in this structure.</p>
316
317 </div>
318<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="OptimizeImageLayers">OptimizeImageLayers</a></h2>
319<div class="doc-section">
320
321<p>OptimizeImageLayers() compares each image the GIF disposed forms of the previous image in the sequence. From this it attempts to select the smallest cropped image to replace each frame, while preserving the results of the GIF animation.</p>
322
323<p>The format of the OptimizeImageLayers method is:</p>
324
325<pre class="code">
326 Image *OptimizeImageLayers(const Image *image,
327 ExceptionInfo *exception)
328</pre>
329
330<p>A description of each parameter follows:</p>
331
332<h5>image</h5>
333<p>the image.</p>
334
335<h5>exception</h5>
336<p>return any errors or warnings in this structure.</p>
337
338 </div>
339<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="OptimizeImagePlusLayers">OptimizeImagePlusLayers</a></h2>
340<div class="doc-section">
341
342<p>OptimizeImagePlusLayers() is exactly as OptimizeImageLayers(), but may also add or even remove extra frames in the animation, if it improves the total number of pixels in the resulting GIF animation.</p>
343
344<p>The format of the OptimizePlusImageLayers method is:</p>
345
346<pre class="code">
347 Image *OptimizePlusImageLayers(const Image *image,
348 ExceptionInfo *exception)
349</pre>
350
351<p>A description of each parameter follows:</p>
352
353<h5>image</h5>
354<p>the image.</p>
355
356<h5>exception</h5>
357<p>return any errors or warnings in this structure.</p>
358
359 </div>
360<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="OptimizeImageTransparency">OptimizeImageTransparency</a></h2>
361<div class="doc-section">
362
363<p>OptimizeImageTransparency() takes a frame optimized GIF animation, and compares the overlayed pixels against the disposal image resulting from all the previous frames in the animation. Any pixel that does not change the disposal image (and thus does not effect the outcome of an overlay) is made transparent.</p>
364
365<p>WARNING: This modifies the current images directly, rather than generate a new image sequence.</p>
366
367<p>The format of the OptimizeImageTransperency method is:</p>
368
369<pre class="code">
370 void OptimizeImageTransperency(Image *image,ExceptionInfo *exception)
371</pre>
372
373<p>A description of each parameter follows:</p>
374
375<h5>image</h5>
376<p>the image sequence</p>
377
378<h5>exception</h5>
379<p>return any errors or warnings in this structure.</p>
380
381 </div>
382<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="RemoveDuplicateLayers">RemoveDuplicateLayers</a></h2>
383<div class="doc-section">
384
385<p>RemoveDuplicateLayers() removes any image that is exactly the same as the next image in the given image list. Image size and virtual canvas offset must also match, though not the virtual canvas size itself.</p>
386
387<p>No check is made with regards to image disposal setting, though it is the dispose setting of later image that is kept. Also any time delays are also added together. As such coalesced image animations should still produce the same result, though with duplicte frames merged into a single frame.</p>
388
389<p>The format of the RemoveDuplicateLayers method is:</p>
390
391<pre class="code">
392 void RemoveDuplicateLayers(Image **image, ExceptionInfo *exception)
393</pre>
394
395<p>A description of each parameter follows:</p>
396
397<h5>images</h5>
398<p>the image list</p>
399
400<h5>exception</h5>
401<p>return any errors or warnings in this structure.</p>
402
403 </div>
404<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="RemoveZeroDelayLayers">RemoveZeroDelayLayers</a></h2>
405<div class="doc-section">
406
407<p>RemoveZeroDelayLayers() removes any image that as a zero delay time. Such images generally represent intermediate or partial updates in GIF animations used for file optimization. They are not ment to be displayed to users of the animation. Viewable images in an animation should have a time delay of 3 or more centi-seconds (hundredths of a second).</p>
408
409<p>However if all the frames have a zero time delay, then either the animation is as yet incomplete, or it is not a GIF animation. This a non-sensible situation, so no image will be removed and a 'Zero Time Animation' warning (exception) given.</p>
410
411<p>No warning will be given if no image was removed because all images had an appropriate non-zero time delay set.</p>
412
413<p>Due to the special requirements of GIF disposal handling, GIF animations should be coalesced first, before calling this function, though that is not a requirement.</p>
414
415<p>The format of the RemoveZeroDelayLayers method is:</p>
416
417<pre class="code">
418 void RemoveZeroDelayLayers(Image **image, ExceptionInfo *exception)
419</pre>
420
421<p>A description of each parameter follows:</p>
422
423<h5>images</h5>
424<p>the image list</p>
425
426<h5>exception</h5>
427<p>return any errors or warnings in this structure.</p>
428
429 </div>
430<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="CompositeLayers">CompositeLayers</a></h2>
431<div class="doc-section">
432
cristy751980d2012-06-03 23:18:35 +0000433<p>CompositeLayers() compose the source image sequence over the destination image sequence, starting with the current image in both lists.</p>
cristy20398432011-08-11 01:31:50 +0000434
cristy751980d2012-06-03 23:18:35 +0000435<p>Each layer from the two image lists are composted together until the end of one of the image lists is reached. The offset of each composition is also adjusted to match the virtual canvas offsets of each layer. As such the given offset is relative to the virtual canvas, and not the actual image.</p>
cristy20398432011-08-11 01:31:50 +0000436
cristy751980d2012-06-03 23:18:35 +0000437<p>Composition uses given x and y offsets, as the 'origin' location of the source images virtual canvas (not the real image) allowing you to compose a list of 'layer images' into the destiantioni images. This makes it well sutiable for directly composing 'Clears Frame Animations' or 'Coaleased Animations' onto a static or other 'Coaleased Animation' destination image list. GIF disposal handling is not looked at.</p>
cristy20398432011-08-11 01:31:50 +0000438
cristy751980d2012-06-03 23:18:35 +0000439<p>Special case:- If one of the image sequences is the last image (just a single image remaining), that image is repeatally composed with all the images in the other image list. Either the source or destination lists may be the single image, for this situation.</p>
cristy20398432011-08-11 01:31:50 +0000440
cristy751980d2012-06-03 23:18:35 +0000441<p>In the case of a single destination image (or last image given), that image will ve cloned to match the number of images remaining in the source image list.</p>
442
443<p>This is equivelent to the "-layer Composite" Shell API operator.</p>
444
cristy20398432011-08-11 01:31:50 +0000445
446<p>The format of the CompositeLayers method is:</p>
447
448<pre class="code">
449 void CompositeLayers(Image *destination,
450 const CompositeOperator compose, Image *source,
451 const ssize_t x_offset, const ssize_t y_offset,
452 ExceptionInfo *exception);
453</pre>
454
455<p>A description of each parameter follows:</p>
456
457<h5>destination</h5>
458<p>the destination images and results</p>
459
460<h5>source</h5>
461<p>source image(s) for the layer composition</p>
462
463<h5>compose, x_offset, y_offset</h5>
464<p>arguments passed on to CompositeImages()</p>
465
466<h5>exception</h5>
467<p>return any errors or warnings in this structure.</p>
468
469 </div>
470<h2><a href="http://www.imagemagick.org/api/MagickCore/layer_8c.html" id="MergeImageLayers">MergeImageLayers</a></h2>
471<div class="doc-section">
472
473<p>MergeImageLayers() composes all the image layers from the current given image onward to produce a single image of the merged layers.</p>
474
cristy72da67d2013-02-24 21:40:48 +0000475<p>The inital canvas's size depends on the given ImageLayerMethod, and is initialized using the first images background color. The images are then compositied onto that image in sequence using the given composition that has been assigned to each individual image.</p>
cristy20398432011-08-11 01:31:50 +0000476
477<p>The format of the MergeImageLayers is:</p>
478
479<pre class="text">
480 Image *MergeImageLayers(const Image *image,
cristy72da67d2013-02-24 21:40:48 +0000481 const ImageLayerMethod method, ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000482</pre>
483
484<p>A description of each parameter follows:</p>
485
486<h5>image</h5>
487<p>the image list to be composited together</p>
488
489<h5>method</h5>
490<p>the method of selecting the size of the initial canvas.</p>
491
492<p>MergeLayer: Merge all layers onto a canvas just large enough to hold all the actual images. The virtual canvas of the first image is preserved but otherwise ignored.</p>
493
494<p>FlattenLayer: Use the virtual canvas size of first image. Images which fall outside this canvas is clipped. This can be used to 'fill out' a given virtual canvas.</p>
495
496<p>MosaicLayer: Start with the virtual canvas of the first image, enlarging left and right edges to contain all images. Images with negative offsets will be clipped.</p>
497
498<p>TrimBoundsLayer: Determine the overall bounds of all the image layers just as in "MergeLayer", then adjust the the canvas and offsets to be relative to those bounds, without overlaying the images.</p>
499
500<p>WARNING: a new image is not returned, the original image sequence page data is modified instead.</p>
501
502<h5>exception</h5>
503<p>return any errors or warnings in this structure.</p>
504
505 </div>
cristy06f63f22012-10-31 00:50:07 +0000506
507</div>
508
509<div id="linkbar">
cristyac1b4322013-07-28 13:58:06 +0000510 <span id="linkbar-west"> </span>
cristy8ee7f242013-06-20 16:08:44 +0000511
cristy06f63f22012-10-31 00:50:07 +0000512 <span id="linkbar-center">
cristydba8f1d2013-07-28 13:49:24 +0000513 <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &#8226;
514 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> &#8226;
cristy8ee7f242013-06-20 16:08:44 +0000515 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
cristy06f63f22012-10-31 00:50:07 +0000516 </span>
cristyac1b4322013-07-28 13:58:06 +0000517 <span id="linkbar-east"> </span>
cristy06f63f22012-10-31 00:50:07 +0000518 </div>
519 <div class="footer">
cristyac1b4322013-07-28 13:58:06 +0000520 <span id="footer-west">© 1999-2013 ImageMagick Studio LLC</span>
cristyd8833bf2013-02-24 22:14:53 +0000521 <span id="footer-east"> <a href="../../www/contact.html">Contact the Wizards</a></span>
cristy06f63f22012-10-31 00:50:07 +0000522 </div>
523 <div style="clear: both; margin: 0; width: 100%; "></div>
cristy06f63f22012-10-31 00:50:07 +0000524</body>
525</html>