• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8  <meta charset="utf-8"  />
9  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
10  <title>ImageMagick - MagickCore, C API: Resize an Image</title>
11  <meta name="application-name" content="ImageMagick" />
12  <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert bitmap images. Resize an image, crop it, change its shades and colors, add captions, and more." />
13  <meta name="application-url" content="https://imagemagick.org" />
14  <meta name="generator" content="PHP" />
15  <meta name="keywords" content="magickcore, c, api:, resize, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert" />
16  <meta name="rating" content="GENERAL" />
17  <meta name="robots" content="INDEX, FOLLOW" />
18  <meta name="generator" content="ImageMagick Studio LLC" />
19  <meta name="author" content="ImageMagick Studio LLC" />
20  <meta name="revisit-after" content="2 DAYS" />
21  <meta name="resource-type" content="document" />
22  <meta name="copyright" content="Copyright (c) 1999-2020 ImageMagick Studio LLC" />
23  <meta name="distribution" content="Global" />
24  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25  <meta property='og:url' content='../../' />
26  <meta property='og:title' content='ImageMagick' />
27  <meta property='og:image' content='../../images/logo.png' />
28  <meta property='og:type' content='website' />
29  <meta property='og:site_name' content='ImageMagick' />
30  <meta property='og:description' content="Convert, Edit, or Compose Bitmap Images" />
31  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
32  <link href="resize.html" rel="canonical" />
33  <link href="../../images/wand.png" rel="icon" />
34  <link href="../../images/wand.ico" rel="shortcut icon" />
35  <link href="../assets/magick.css" rel="stylesheet" />
36</head>
37<body>
38  <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
39    <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../images/wand.ico"/></a>
40    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
41      <span class="navbar-toggler-icon"></span>
42    </button>
43
44    <div class="navbar-collapse collapse" id="navbarsMagick" style="">
45    <ul class="navbar-nav mr-auto">
46      <li class="nav-item ">
47        <a class="nav-link" href="../../">Home <span class="sr-only">(current)</span></a>
48      </li>
49      <li class="nav-item ">
50        <a class="nav-link" href="../../www/download.html">Download</a>
51      </li>
52      <li class="nav-item ">
53        <a class="nav-link" href="../../www/command-line-tools.html">Tools</a>
54      </li>
55      <li class="nav-item ">
56        <a class="nav-link" href="../../www/command-line-processing.html">Command-line</a>
57      </li>
58      <li class="nav-item ">
59        <a class="nav-link" href="../../www/resources.html">Resources</a>
60      </li>
61      <li class="nav-item ">
62        <a class="nav-link" href="../../www/develop.html">Develop</a>
63      </li>
64      <li class="nav-item">
65        <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a>
66      </li>
67    </ul>
68    <form class="form-inline my-2 my-lg-0" action="../https://imagemagick.org/script/search.php">
69      <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
70      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
71    </form>
72    </div>
73  </nav>
74  <div class="container">
75   <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
76         style="display:block"
77         data-ad-client="ca-pub-3129977114552745"
78         data-ad-slot="6345125851"
79         data-full-width-responsive="true"
80         data-ad-format="horizontal"></ins>
81    <script>
82      (adsbygoogle = window.adsbygoogle || []).push({});
83    </script>
84
85  </div>
86
87  <main class="container">
88    <div class="magick-template">
89<div class="magick-header">
90<p class="text-center"><a href="resize.html#AdaptiveResizeImage">AdaptiveResizeImage</a> &#8226; <a href="resize.html#InterpolativeResizeImage">InterpolativeResizeImage</a> &#8226; <a href="resize.html#LiquidRescaleImage">LiquidRescaleImage</a> &#8226; <a href="resize.html#MagnifyImage">MagnifyImage</a> &#8226; <a href="resize.html#MinifyImage">MinifyImage</a> &#8226; <a href="resize.html#ResampleImage">ResampleImage</a> &#8226; <a href="resize.html#ResizeImage">ResizeImage</a> &#8226; <a href="resize.html#SampleImage">SampleImage</a> &#8226; <a href="resize.html#ScaleImage">ScaleImage</a> &#8226; <a href="resize.html#ThumbnailImage">ThumbnailImage</a></p>
91
92<h2><a href="../../api/MagickCore/resize_8c.html" id="AdaptiveResizeImage">AdaptiveResizeImage</a></h2>
93
94<p>AdaptiveResizeImage() adaptively resize image with pixel resampling.</p>
95
96<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>
97
98<p>The format of the AdaptiveResizeImage method is:</p>
99
100<pre class="text">
101Image *AdaptiveResizeImage(const Image *image,const size_t columns,
102  const size_t rows,ExceptionInfo *exception)
103</pre>
104
105<p>A description of each parameter follows:</p>
106
107<dd>
108</dd>
109
110<dd> </dd>
111<dl class="dl-horizontal">
112<dt>image</dt>
113<dd>the image. </dd>
114
115<dd> </dd>
116<dt>columns</dt>
117<dd>the number of columns in the resized image. </dd>
118
119<dd> </dd>
120<dt>rows</dt>
121<dd>the number of rows in the resized image. </dd>
122
123<dd> </dd>
124<dt>exception</dt>
125<dd>return any errors or warnings in this structure. </dd>
126
127<dd>  </dd>
128</dl>
129<h2><a href="../../api/MagickCore/resize_8c.html" id="InterpolativeResizeImage">InterpolativeResizeImage</a></h2>
130
131<p>InterpolativeResizeImage() resizes an image using the specified interpolation method.</p>
132
133<p>The format of the InterpolativeResizeImage method is:</p>
134
135<pre class="text">
136Image *InterpolativeResizeImage(const Image *image,const size_t columns,
137  const size_t rows,const PixelInterpolateMethod method,
138  ExceptionInfo *exception)
139</pre>
140
141<p>A description of each parameter follows:</p>
142
143<dd>
144</dd>
145
146<dd> </dd>
147<dl class="dl-horizontal">
148<dt>image</dt>
149<dd>the image. </dd>
150
151<dd> </dd>
152<dt>columns</dt>
153<dd>the number of columns in the resized image. </dd>
154
155<dd> </dd>
156<dt>rows</dt>
157<dd>the number of rows in the resized image. </dd>
158
159<dd> </dd>
160<dt>method</dt>
161<dd>the pixel interpolation method. </dd>
162
163<dd> </dd>
164<dt>exception</dt>
165<dd>return any errors or warnings in this structure. </dd>
166
167<dd>  </dd>
168</dl>
169<h2><a href="../../api/MagickCore/resize_8c.html" id="LiquidRescaleImage">LiquidRescaleImage</a></h2>
170
171<p>LiquidRescaleImage() rescales image with seam carving.</p>
172
173<p>The format of the LiquidRescaleImage method is:</p>
174
175<pre class="text">
176Image *LiquidRescaleImage(const Image *image,const size_t columns,
177  const size_t rows,const double delta_x,const double rigidity,
178  ExceptionInfo *exception)
179</pre>
180
181<p>A description of each parameter follows:</p>
182
183<dd>
184</dd>
185
186<dd> </dd>
187<dl class="dl-horizontal">
188<dt>image</dt>
189<dd>the image. </dd>
190
191<dd> </dd>
192<dt>columns</dt>
193<dd>the number of columns in the rescaled image. </dd>
194
195<dd> </dd>
196<dt>rows</dt>
197<dd>the number of rows in the rescaled image. </dd>
198
199<dd> </dd>
200<dt>delta_x</dt>
201<dd>maximum seam transversal step (0 means straight seams). </dd>
202
203<dd> </dd>
204<dt>rigidity</dt>
205<dd>introduce a bias for non-straight seams (typically 0). </dd>
206
207<dd> </dd>
208<dt>exception</dt>
209<dd>return any errors or warnings in this structure. </dd>
210
211<dd>  </dd>
212</dl>
213<h2><a href="../../api/MagickCore/resize_8c.html" id="MagnifyImage">MagnifyImage</a></h2>
214
215<p>MagnifyImage() doubles the size of the image with a pixel art scaling algorithm.</p>
216
217<p>The format of the MagnifyImage method is:</p>
218
219<pre class="text">
220Image *MagnifyImage(const Image *image,ExceptionInfo *exception)
221</pre>
222
223<p>A description of each parameter follows:</p>
224
225<dd>
226</dd>
227
228<dd> </dd>
229<dl class="dl-horizontal">
230<dt>image</dt>
231<dd>the image. </dd>
232
233<dd> </dd>
234<dt>exception</dt>
235<dd>return any errors or warnings in this structure. </dd>
236
237<dd>  </dd>
238</dl>
239<h2><a href="../../api/MagickCore/resize_8c.html" id="MinifyImage">MinifyImage</a></h2>
240
241<p>MinifyImage() is a convenience method that scales an image proportionally to half its size.</p>
242
243<p>The format of the MinifyImage method is:</p>
244
245<pre class="text">
246Image *MinifyImage(const Image *image,ExceptionInfo *exception)
247</pre>
248
249<p>A description of each parameter follows:</p>
250
251<dd>
252</dd>
253
254<dd> </dd>
255<dl class="dl-horizontal">
256<dt>image</dt>
257<dd>the image. </dd>
258
259<dd> </dd>
260<dt>exception</dt>
261<dd>return any errors or warnings in this structure. </dd>
262
263<dd>  </dd>
264</dl>
265<h2><a href="../../api/MagickCore/resize_8c.html" id="ResampleImage">ResampleImage</a></h2>
266
267<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>
268
269<p>The format of the ResampleImage method is:</p>
270
271<pre class="text">
272Image *ResampleImage(Image *image,const double x_resolution,
273  const double y_resolution,const FilterType filter,
274  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 to be resized to fit the given resolution. </dd>
286
287<dd> </dd>
288<dt>x_resolution</dt>
289<dd>the new image x resolution. </dd>
290
291<dd> </dd>
292<dt>y_resolution</dt>
293<dd>the new image y resolution. </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="../../api/MagickCore/resize_8c.html" id="ResizeImage">ResizeImage</a></h2>
306
307<p>ResizeImage() scales an image to the desired dimensions, using the given filter (see AcquireFilterInfo()).</p>
308
309<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>
310
311<p>ResizeImage() was inspired by Paul Heckbert's "zoom" program.</p>
312
313<p>The format of the ResizeImage method is:</p>
314
315<pre class="text">
316Image *ResizeImage(Image *image,const size_t columns,const size_t rows,
317  const FilterType filter,ExceptionInfo *exception)
318</pre>
319
320<p>A description of each parameter follows:</p>
321
322<dd>
323</dd>
324
325<dd> </dd>
326<dl class="dl-horizontal">
327<dt>image</dt>
328<dd>the image. </dd>
329
330<dd> </dd>
331<dt>columns</dt>
332<dd>the number of columns in the scaled image. </dd>
333
334<dd> </dd>
335<dt>rows</dt>
336<dd>the number of rows in the scaled image. </dd>
337
338<dd> </dd>
339<dt>filter</dt>
340<dd>Image filter to use. </dd>
341
342<dd> </dd>
343<dt>exception</dt>
344<dd>return any errors or warnings in this structure. </dd>
345
346<dd>  </dd>
347</dl>
348<h2><a href="../../api/MagickCore/resize_8c.html" id="SampleImage">SampleImage</a></h2>
349
350<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>
351
352<p>The format of the SampleImage method is:</p>
353
354<pre class="text">
355Image *SampleImage(const Image *image,const size_t columns,
356  const size_t rows,ExceptionInfo *exception)
357</pre>
358
359<p>A description of each parameter follows:</p>
360
361<dd>
362</dd>
363
364<dd> </dd>
365<dl class="dl-horizontal">
366<dt>image</dt>
367<dd>the image. </dd>
368
369<dd> </dd>
370<dt>columns</dt>
371<dd>the number of columns in the sampled image. </dd>
372
373<dd> </dd>
374<dt>rows</dt>
375<dd>the number of rows in the sampled image. </dd>
376
377<dd> </dd>
378<dt>exception</dt>
379<dd>return any errors or warnings in this structure. </dd>
380
381<dd>  </dd>
382</dl>
383<h2><a href="../../api/MagickCore/resize_8c.html" id="ScaleImage">ScaleImage</a></h2>
384
385<p>ScaleImage() changes the size of an image to the given dimensions.</p>
386
387<p>The format of the ScaleImage method is:</p>
388
389<pre class="text">
390Image *ScaleImage(const Image *image,const size_t columns,
391  const size_t rows,ExceptionInfo *exception)
392</pre>
393
394<p>A description of each parameter follows:</p>
395
396<dd>
397</dd>
398
399<dd> </dd>
400<dl class="dl-horizontal">
401<dt>image</dt>
402<dd>the image. </dd>
403
404<dd> </dd>
405<dt>columns</dt>
406<dd>the number of columns in the scaled image. </dd>
407
408<dd> </dd>
409<dt>rows</dt>
410<dd>the number of rows in the scaled image. </dd>
411
412<dd> </dd>
413<dt>exception</dt>
414<dd>return any errors or warnings in this structure. </dd>
415
416<dd>  </dd>
417</dl>
418<h2><a href="../../api/MagickCore/resize_8c.html" id="ThumbnailImage">ThumbnailImage</a></h2>
419
420<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>
421
422<p>The format of the ThumbnailImage method is:</p>
423
424<pre class="text">
425Image *ThumbnailImage(const Image *image,const size_t columns,
426  const size_t rows,ExceptionInfo *exception)
427</pre>
428
429<p>A description of each parameter follows:</p>
430
431<dd>
432</dd>
433
434<dd> </dd>
435<dl class="dl-horizontal">
436<dt>image</dt>
437<dd>the image. </dd>
438
439<dd> </dd>
440<dt>columns</dt>
441<dd>the number of columns in the scaled image. </dd>
442
443<dd> </dd>
444<dt>rows</dt>
445<dd>the number of rows in the scaled image. </dd>
446
447<dd> </dd>
448<dt>exception</dt>
449<dd>return any errors or warnings in this structure. </dd>
450
451<dd>  </dd>
452</dl>
453</div>
454    </div>
455  </main><!-- /.container -->
456  <footer class="magick-footer">
457    <p><a href="../../www/security-policy.html">Security</a> •
458    <a href="../../www/architecture.html">Architecture</a>
459
460    <a href="resize.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../images/wand.ico"/></a>
461
462    <a href="../../www/links.html">Related</a> •
463     <a href="../../www/sitemap.html">Sitemap</a>
464    <br/>
465    <a href="../../www/support.html">Donate</a> •
466    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
467    <a href="../../www/contact.html">Contact Us</a>
468    <br/>
469    <small>© 1999-2020 ImageMagick Studio LLC</small></p>
470  </footer>
471
472  <!-- Javascript assets -->
473  <script src="../assets/magick.js" crossorigin="anonymous"></script>
474  <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.4.1/jquery.min.js"><\/script>')</script>
475</body>
476</html>
477<!-- Magick Cache 2nd January 2020 23:22 -->