blob: 8ebc25a59388348c2bfe4ba30b22f46e04701186 [file] [log] [blame]
cristy29dc8652015-05-12 16:26:21 +00001<!DOCTYPE html>
cristy44443b92015-05-05 00:06:07 +00002<html lang="en">
cristy06f63f22012-10-31 00:50:07 +00003<head>
Cristy36421ee2015-08-28 11:58:20 -04004
cristy29f2c972015-07-28 13:37:46 +00005 <title>ImageMagick: MagickCore, C API for ImageMagick: Resize an Image</title>
cristy44443b92015-05-05 00:06:07 +00006 <meta http-equiv="content-type" content="text/html; charset=utf-8">
cristy44443b92015-05-05 00:06:07 +00007 <meta name="application-name" content="ImageMagick">
8 <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.">
9 <meta name="application-url" content="http://www.imagemagick.org">
10 <meta name="generator" content="PHP">
11 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, resize, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
12 <meta name="rating" content="GENERAL">
13 <meta name="robots" content="INDEX, FOLLOW">
14 <meta name="generator" content="ImageMagick Studio LLC">
15 <meta name="author" content="ImageMagick Studio LLC">
16 <meta name="revisit-after" content="2 DAYS">
17 <meta name="resource-type" content="document">
cristy4e638cd2015-05-07 16:47:40 +000018 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC">
cristy44443b92015-05-05 00:06:07 +000019 <meta name="distribution" content="Global">
20 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
cristy354f1172015-07-29 14:03:48 +000021 <link rel="icon" href="../images/wand.png">
22 <link rel="shortcut icon" href="../images/wand.ico">
23 <link rel="stylesheet" href="../css/magick.html">
cristy06f63f22012-10-31 00:50:07 +000024</head>
cristy44443b92015-05-05 00:06:07 +000025<body>
cristy06f63f22012-10-31 00:50:07 +000026<div class="main">
cristy44443b92015-05-05 00:06:07 +000027<div class="magick-masthead">
28 <div class="container">
Cristy36421ee2015-08-28 11:58:20 -040029 <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3129977114552745" data-ad-slot="6345125851" data-ad-format="auto"></ins>
cristy29f2c972015-07-28 13:37:46 +000030 <script>
31 (adsbygoogle = window.adsbygoogle || []).push({});
cristy44443b92015-05-05 00:06:07 +000032 </script>
cristy44443b92015-05-05 00:06:07 +000033 <nav class="magick-nav">
cristy2f563d42015-05-06 23:36:51 +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>
cristy38185362015-05-07 20:09:56 +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>
cristy44443b92015-05-05 00:06:07 +000042 </nav>
43 </div>
44</div>
45<div class="container">
cristy4e638cd2015-05-07 16:47:40 +000046<div class="magick-header">
cristy99513ee2015-06-21 00:00:03 +000047<p class="text-center"><a href="resize.html#AdaptiveResizeImage">AdaptiveResizeImage</a><a href="resize.html#InterpolativeResizeImage">InterpolativeResizeImage</a><a href="resize.html#LiquidRescaleImage">LiquidRescaleImage</a><a href="resize.html#MagnifyImage">MagnifyImage</a><a href="resize.html#MinifyImage">MinifyImage</a><a href="resize.html#ResampleImage">ResampleImage</a><a href="resize.html#ResizeImage">ResizeImage</a><a href="resize.html#SampleImage">SampleImage</a><a href="resize.html#ScaleImage">ScaleImage</a><a href="resize.html#ThumbnailImage">ThumbnailImage</a></p>
cristy06f63f22012-10-31 00:50:07 +000048
cristycecc9492015-06-09 16:53:50 +000049<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="AdaptiveResizeImage">AdaptiveResizeImage</a></h2>
50
51<p>AdaptiveResizeImage() adaptively resize image with pixel resampling.</p>
52
53<p>This is shortcut function for a fast interpolative resize using mesh interpolation. It works well for small resizes of less than +/- 50 of the original image size. For larger resizing on images a full filtered and slower resize function should be used instead.</p>
54
55<p>The format of the AdaptiveResizeImage method is:</p>
56
57<pre class="text">
58Image *AdaptiveResizeImage(const Image *image,const size_t columns,
59 const size_t rows,ExceptionInfo *exception)
60</pre>
61
62<p>A description of each parameter follows:</p>
63
64<dd>
65</dd>
66
67<dd> </dd>
68<dl class="dl-horizontal">
69<dt>image</dt>
70<dd>the image. </dd>
71
72<dd> </dd>
73<dt>columns</dt>
74<dd>the number of columns in the resized image. </dd>
75
76<dd> </dd>
77<dt>rows</dt>
78<dd>the number of rows in the resized image. </dd>
79
80<dd> </dd>
81<dt>exception</dt>
82<dd>return any errors or warnings in this structure. </dd>
83
84<dd> </dd>
85</dl>
86<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="InterpolativeResizeImage">InterpolativeResizeImage</a></h2>
87
88<p>InterpolativeResizeImage() resizes an image using the specified interpolation method.</p>
89
90<p>The format of the InterpolativeResizeImage method is:</p>
91
92<pre class="text">
93Image *InterpolativeResizeImage(const Image *image,const size_t columns,
94 const size_t rows,const PixelInterpolateMethod method,
95 ExceptionInfo *exception)
96</pre>
97
98<p>A description of each parameter follows:</p>
99
100<dd>
101</dd>
102
103<dd> </dd>
104<dl class="dl-horizontal">
105<dt>image</dt>
106<dd>the image. </dd>
107
108<dd> </dd>
109<dt>columns</dt>
110<dd>the number of columns in the resized image. </dd>
111
112<dd> </dd>
113<dt>rows</dt>
114<dd>the number of rows in the resized image. </dd>
115
116<dd> </dd>
117<dt>method</dt>
118<dd>the pixel interpolation method. </dd>
119
120<dd> </dd>
121<dt>exception</dt>
122<dd>return any errors or warnings in this structure. </dd>
123
124<dd> </dd>
125</dl>
126<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="LiquidRescaleImage">LiquidRescaleImage</a></h2>
127
128<p>LiquidRescaleImage() rescales image with seam carving.</p>
129
130<p>The format of the LiquidRescaleImage method is:</p>
131
132<pre class="text">
133Image *LiquidRescaleImage(const Image *image,const size_t columns,
134 const size_t rows,const double delta_x,const double rigidity,
135 ExceptionInfo *exception)
136</pre>
137
138<p>A description of each parameter follows:</p>
139
140<dd>
141</dd>
142
143<dd> </dd>
144<dl class="dl-horizontal">
145<dt>image</dt>
146<dd>the image. </dd>
147
148<dd> </dd>
149<dt>columns</dt>
150<dd>the number of columns in the rescaled image. </dd>
151
152<dd> </dd>
153<dt>rows</dt>
154<dd>the number of rows in the rescaled image. </dd>
155
156<dd> </dd>
157<dt>delta_x</dt>
158<dd>maximum seam transversal step (0 means straight seams). </dd>
159
160<dd> </dd>
161<dt>rigidity</dt>
162<dd>introduce a bias for non-straight seams (typically 0). </dd>
163
164<dd> </dd>
165<dt>exception</dt>
166<dd>return any errors or warnings in this structure. </dd>
167
168<dd> </dd>
169</dl>
170<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="MagnifyImage">MagnifyImage</a></h2>
171
172<p>MagnifyImage() doubles the size of the image with a pixel art scaling algorithm.</p>
173
174<p>The format of the MagnifyImage method is:</p>
175
176<pre class="text">
177Image *MagnifyImage(const Image *image,ExceptionInfo *exception)
178</pre>
179
180<p>A description of each parameter follows:</p>
181
182<dd>
183</dd>
184
185<dd> </dd>
186<dl class="dl-horizontal">
187<dt>image</dt>
188<dd>the image. </dd>
189
190<dd> </dd>
191<dt>exception</dt>
192<dd>return any errors or warnings in this structure. </dd>
193
194<dd> </dd>
195</dl>
196<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="MinifyImage">MinifyImage</a></h2>
197
198<p>MinifyImage() is a convenience method that scales an image proportionally to half its size.</p>
199
200<p>The format of the MinifyImage method is:</p>
201
202<pre class="text">
203Image *MinifyImage(const Image *image,ExceptionInfo *exception)
204</pre>
205
206<p>A description of each parameter follows:</p>
207
208<dd>
209</dd>
210
211<dd> </dd>
212<dl class="dl-horizontal">
213<dt>image</dt>
214<dd>the image. </dd>
215
216<dd> </dd>
217<dt>exception</dt>
218<dd>return any errors or warnings in this structure. </dd>
219
220<dd> </dd>
221</dl>
222<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="ResampleImage">ResampleImage</a></h2>
223
224<p>ResampleImage() resize image in terms of its pixel size, so that when displayed at the given resolution it will be the same size in terms of real world units as the original image at the original resolution.</p>
225
226<p>The format of the ResampleImage method is:</p>
227
228<pre class="text">
229Image *ResampleImage(Image *image,const double x_resolution,
230 const double y_resolution,const FilterTypes filter,
231 ExceptionInfo *exception)
232</pre>
233
234<p>A description of each parameter follows:</p>
235
236<dd>
237</dd>
238
239<dd> </dd>
240<dl class="dl-horizontal">
241<dt>image</dt>
242<dd>the image to be resized to fit the given resolution. </dd>
243
244<dd> </dd>
245<dt>x_resolution</dt>
246<dd>the new image x resolution. </dd>
247
248<dd> </dd>
249<dt>y_resolution</dt>
250<dd>the new image y resolution. </dd>
251
252<dd> </dd>
253<dt>filter</dt>
254<dd>Image filter to use. </dd>
255
256<dd> </dd>
257<dt>exception</dt>
258<dd>return any errors or warnings in this structure. </dd>
259
260<dd> </dd>
261</dl>
262<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="ResizeImage">ResizeImage</a></h2>
263
264<p>ResizeImage() scales an image to the desired dimensions, using the given filter (see AcquireFilterInfo()).</p>
265
266<p>If an undefined filter is given the filter defaults to Mitchell for a colormapped image, a image with a matte channel, or if the image is enlarged. Otherwise the filter defaults to a Lanczos.</p>
267
268<p>ResizeImage() was inspired by Paul Heckbert's "zoom" program.</p>
269
270<p>The format of the ResizeImage method is:</p>
271
272<pre class="text">
273Image *ResizeImage(Image *image,const size_t columns,const size_t rows,
274 const FilterTypes filter,ExceptionInfo *exception)
275</pre>
276
277<p>A description of each parameter follows:</p>
278
279<dd>
280</dd>
281
282<dd> </dd>
283<dl class="dl-horizontal">
284<dt>image</dt>
285<dd>the image. </dd>
286
287<dd> </dd>
288<dt>columns</dt>
289<dd>the number of columns in the scaled image. </dd>
290
291<dd> </dd>
292<dt>rows</dt>
293<dd>the number of rows in the scaled image. </dd>
294
295<dd> </dd>
296<dt>filter</dt>
297<dd>Image filter to use. </dd>
298
299<dd> </dd>
300<dt>exception</dt>
301<dd>return any errors or warnings in this structure. </dd>
302
303<dd> </dd>
304</dl>
305<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="SampleImage">SampleImage</a></h2>
306
307<p>SampleImage() scales an image to the desired dimensions with pixel sampling. Unlike other scaling methods, this method does not introduce any additional color into the scaled image.</p>
308
309<p>The format of the SampleImage method is:</p>
310
311<pre class="text">
312Image *SampleImage(const Image *image,const size_t columns,
313 const size_t rows,ExceptionInfo *exception)
314</pre>
315
316<p>A description of each parameter follows:</p>
317
318<dd>
319</dd>
320
321<dd> </dd>
322<dl class="dl-horizontal">
323<dt>image</dt>
324<dd>the image. </dd>
325
326<dd> </dd>
327<dt>columns</dt>
328<dd>the number of columns in the sampled image. </dd>
329
330<dd> </dd>
331<dt>rows</dt>
332<dd>the number of rows in the sampled image. </dd>
333
334<dd> </dd>
335<dt>exception</dt>
336<dd>return any errors or warnings in this structure. </dd>
337
338<dd> </dd>
339</dl>
340<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="ScaleImage">ScaleImage</a></h2>
341
342<p>ScaleImage() changes the size of an image to the given dimensions.</p>
343
344<p>The format of the ScaleImage method is:</p>
345
346<pre class="text">
347Image *ScaleImage(const Image *image,const size_t columns,
348 const size_t rows,ExceptionInfo *exception)
349</pre>
350
351<p>A description of each parameter follows:</p>
352
353<dd>
354</dd>
355
356<dd> </dd>
357<dl class="dl-horizontal">
358<dt>image</dt>
359<dd>the image. </dd>
360
361<dd> </dd>
362<dt>columns</dt>
363<dd>the number of columns in the scaled image. </dd>
364
365<dd> </dd>
366<dt>rows</dt>
367<dd>the number of rows in the scaled image. </dd>
368
369<dd> </dd>
370<dt>exception</dt>
371<dd>return any errors or warnings in this structure. </dd>
372
373<dd> </dd>
374</dl>
375<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/resize_8c.html" id="ThumbnailImage">ThumbnailImage</a></h2>
376
377<p>ThumbnailImage() changes the size of an image to the given dimensions and removes any associated profiles. The goal is to produce small low cost thumbnail images suited for display on the Web.</p>
378
379<p>The format of the ThumbnailImage method is:</p>
380
381<pre class="text">
382Image *ThumbnailImage(const Image *image,const size_t columns,
383 const size_t rows,ExceptionInfo *exception)
384</pre>
385
386<p>A description of each parameter follows:</p>
387
388<dd>
389</dd>
390
391<dd> </dd>
392<dl class="dl-horizontal">
393<dt>image</dt>
394<dd>the image. </dd>
395
396<dd> </dd>
397<dt>columns</dt>
398<dd>the number of columns in the scaled image. </dd>
399
400<dd> </dd>
401<dt>rows</dt>
402<dd>the number of rows in the scaled image. </dd>
403
404<dd> </dd>
405<dt>exception</dt>
406<dd>return any errors or warnings in this structure. </dd>
407
408<dd> </dd>
409</dl>
cristy06f63f22012-10-31 00:50:07 +0000410</div>
cristy44443b92015-05-05 00:06:07 +0000411 <footer class="magick-footer">
cristy29f2c972015-07-28 13:37:46 +0000412 <p><a href="../support.html">Donate</a>
413 <a href="../sitemap.html">Sitemap</a>
cristy38185362015-05-07 20:09:56 +0000414 <a href="../links.html">Related</a>
cristy29f2c972015-07-28 13:37:46 +0000415 <a href="../architecture.html">Architecture</a>
cristy44443b92015-05-05 00:06:07 +0000416</p>
417 <p><a href="resize.html#">Back to top</a>
cristyea2793e2015-05-31 16:52:26 +0000418 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
cristy5b8fe762015-06-09 16:24:03 +0000419 <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
Cristy36421ee2015-08-28 11:58:20 -0400420 <p><small>© 1999-2015 ImageMagick Studio LLC</small></p>
cristy44443b92015-05-05 00:06:07 +0000421 </footer>
422</div><!-- /.container -->
cristy06f63f22012-10-31 00:50:07 +0000423
cristy29f2c972015-07-28 13:37:46 +0000424 <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
cristy44cbd482013-08-04 20:53:36 +0000425</div>
cristy06f63f22012-10-31 00:50:07 +0000426</body>
cristy5a367e42015-05-05 12:39:18 +0000427</html>