1 2 3 4 5<!DOCTYPE html> 6<html lang="en"> 7<head> 8 <title>ImageMagick: MagickCore, C API for ImageMagick: Resize an Image</title> 9 <meta charset="utf-8" /> 10 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 11 <meta name="viewport" content="width=device-width, initial-scale=1" /> 12 <meta http-equiv="content-type" content="text/html; charset=utf-8"/> 13 <meta name="application-name" content="ImageMagick"/> 14 <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."/> 15 <meta name="application-url" content="http://www.imagemagick.org"/> 16 <meta name="generator" content="PHP"/> 17 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, resize, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/> 18 <meta name="rating" content="GENERAL"/> 19 <meta name="robots" content="INDEX, FOLLOW"/> 20 <meta name="generator" content="ImageMagick Studio LLC"/> 21 <meta name="author" content="ImageMagick Studio LLC"/> 22 <meta name="revisit-after" content="2 DAYS"/> 23 <meta name="resource-type" content="document"/> 24 <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/> 25 <meta name="distribution" content="Global"/> 26 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/> 27 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 28 <link rel="icon" href="../images/wand.png"/> 29 <link rel="shortcut icon" href="../images/wand.ico"/> 30 <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700"> 31 <link rel="stylesheet" href="../css/magick.html"/> 32</head> 33<body> 34<div class="main"> 35<div class="magick-masthead"> 36 <div class="container"> 37 <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" 38 style="display:block" 39 data-ad-client="ca-pub-3129977114552745" 40 data-ad-slot="6345125851" 41 data-ad-format="auto"></ins> 42 <script> 43 (adsbygoogle = window.adsbygoogle || []).push({}); 44 </script> 45 <nav class="magick-nav"> 46 <a class="magick-nav-item " href="../index.html">Home</a> 47 <a class="magick-nav-item " href="../binary-releases.html">Download</a> 48 <a class="magick-nav-item " href="../command-line-tools.html">Tools</a> 49 <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a> 50 <a class="magick-nav-item " href="../resources.html">Resources</a> 51 <a class="magick-nav-item " href="api.html">Develop</a> 52 <a class="magick-nav-item " href="http://www.imagemagick.org/script/search.php">Search</a> 53 <a class="magick-nav-item pull-right" href="https://www.imagemagick.org/discourse-server/">Community</a> 54 </nav> 55 </div> 56</div> 57<div class="container"> 58<div class="magick-header"> 59<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> 60 61<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="AdaptiveResizeImage">AdaptiveResizeImage</a></h2> 62 63<p>AdaptiveResizeImage() adaptively resize image with pixel resampling.</p> 64 65<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> 66 67<p>The format of the AdaptiveResizeImage method is:</p> 68 69<pre class="text"> 70Image *AdaptiveResizeImage(const Image *image,const size_t columns, 71 const size_t rows,ExceptionInfo *exception) 72</pre> 73 74<p>A description of each parameter follows:</p> 75 76<dd> 77</dd> 78 79<dd> </dd> 80<dl class="dl-horizontal"> 81<dt>image</dt> 82<dd>the image. </dd> 83 84<dd> </dd> 85<dt>columns</dt> 86<dd>the number of columns in the resized image. </dd> 87 88<dd> </dd> 89<dt>rows</dt> 90<dd>the number of rows in the resized image. </dd> 91 92<dd> </dd> 93<dt>exception</dt> 94<dd>return any errors or warnings in this structure. </dd> 95 96<dd> </dd> 97</dl> 98<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="InterpolativeResizeImage">InterpolativeResizeImage</a></h2> 99 100<p>InterpolativeResizeImage() resizes an image using the specified interpolation method.</p> 101 102<p>The format of the InterpolativeResizeImage method is:</p> 103 104<pre class="text"> 105Image *InterpolativeResizeImage(const Image *image,const size_t columns, 106 const size_t rows,const PixelInterpolateMethod method, 107 ExceptionInfo *exception) 108</pre> 109 110<p>A description of each parameter follows:</p> 111 112<dd> 113</dd> 114 115<dd> </dd> 116<dl class="dl-horizontal"> 117<dt>image</dt> 118<dd>the image. </dd> 119 120<dd> </dd> 121<dt>columns</dt> 122<dd>the number of columns in the resized image. </dd> 123 124<dd> </dd> 125<dt>rows</dt> 126<dd>the number of rows in the resized image. </dd> 127 128<dd> </dd> 129<dt>method</dt> 130<dd>the pixel interpolation method. </dd> 131 132<dd> </dd> 133<dt>exception</dt> 134<dd>return any errors or warnings in this structure. </dd> 135 136<dd> </dd> 137</dl> 138<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="LiquidRescaleImage">LiquidRescaleImage</a></h2> 139 140<p>LiquidRescaleImage() rescales image with seam carving.</p> 141 142<p>The format of the LiquidRescaleImage method is:</p> 143 144<pre class="text"> 145Image *LiquidRescaleImage(const Image *image,const size_t columns, 146 const size_t rows,const double delta_x,const double rigidity, 147 ExceptionInfo *exception) 148</pre> 149 150<p>A description of each parameter follows:</p> 151 152<dd> 153</dd> 154 155<dd> </dd> 156<dl class="dl-horizontal"> 157<dt>image</dt> 158<dd>the image. </dd> 159 160<dd> </dd> 161<dt>columns</dt> 162<dd>the number of columns in the rescaled image. </dd> 163 164<dd> </dd> 165<dt>rows</dt> 166<dd>the number of rows in the rescaled image. </dd> 167 168<dd> </dd> 169<dt>delta_x</dt> 170<dd>maximum seam transversal step (0 means straight seams). </dd> 171 172<dd> </dd> 173<dt>rigidity</dt> 174<dd>introduce a bias for non-straight seams (typically 0). </dd> 175 176<dd> </dd> 177<dt>exception</dt> 178<dd>return any errors or warnings in this structure. </dd> 179 180<dd> </dd> 181</dl> 182<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="MagnifyImage">MagnifyImage</a></h2> 183 184<p>MagnifyImage() doubles the size of the image with a pixel art scaling algorithm.</p> 185 186<p>The format of the MagnifyImage method is:</p> 187 188<pre class="text"> 189Image *MagnifyImage(const Image *image,ExceptionInfo *exception) 190</pre> 191 192<p>A description of each parameter follows:</p> 193 194<dd> 195</dd> 196 197<dd> </dd> 198<dl class="dl-horizontal"> 199<dt>image</dt> 200<dd>the image. </dd> 201 202<dd> </dd> 203<dt>exception</dt> 204<dd>return any errors or warnings in this structure. </dd> 205 206<dd> </dd> 207</dl> 208<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="MinifyImage">MinifyImage</a></h2> 209 210<p>MinifyImage() is a convenience method that scales an image proportionally to half its size.</p> 211 212<p>The format of the MinifyImage method is:</p> 213 214<pre class="text"> 215Image *MinifyImage(const Image *image,ExceptionInfo *exception) 216</pre> 217 218<p>A description of each parameter follows:</p> 219 220<dd> 221</dd> 222 223<dd> </dd> 224<dl class="dl-horizontal"> 225<dt>image</dt> 226<dd>the image. </dd> 227 228<dd> </dd> 229<dt>exception</dt> 230<dd>return any errors or warnings in this structure. </dd> 231 232<dd> </dd> 233</dl> 234<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="ResampleImage">ResampleImage</a></h2> 235 236<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> 237 238<p>The format of the ResampleImage method is:</p> 239 240<pre class="text"> 241Image *ResampleImage(Image *image,const double x_resolution, 242 const double y_resolution,const FilterType filter, 243 ExceptionInfo *exception) 244</pre> 245 246<p>A description of each parameter follows:</p> 247 248<dd> 249</dd> 250 251<dd> </dd> 252<dl class="dl-horizontal"> 253<dt>image</dt> 254<dd>the image to be resized to fit the given resolution. </dd> 255 256<dd> </dd> 257<dt>x_resolution</dt> 258<dd>the new image x resolution. </dd> 259 260<dd> </dd> 261<dt>y_resolution</dt> 262<dd>the new image y resolution. </dd> 263 264<dd> </dd> 265<dt>filter</dt> 266<dd>Image filter to use. </dd> 267 268<dd> </dd> 269<dt>exception</dt> 270<dd>return any errors or warnings in this structure. </dd> 271 272<dd> </dd> 273</dl> 274<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="ResizeImage">ResizeImage</a></h2> 275 276<p>ResizeImage() scales an image to the desired dimensions, using the given filter (see AcquireFilterInfo()).</p> 277 278<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> 279 280<p>ResizeImage() was inspired by Paul Heckbert's "zoom" program.</p> 281 282<p>The format of the ResizeImage method is:</p> 283 284<pre class="text"> 285Image *ResizeImage(Image *image,const size_t columns,const size_t rows, 286 const FilterType filter,ExceptionInfo *exception) 287</pre> 288 289<p>A description of each parameter follows:</p> 290 291<dd> 292</dd> 293 294<dd> </dd> 295<dl class="dl-horizontal"> 296<dt>image</dt> 297<dd>the image. </dd> 298 299<dd> </dd> 300<dt>columns</dt> 301<dd>the number of columns in the scaled image. </dd> 302 303<dd> </dd> 304<dt>rows</dt> 305<dd>the number of rows in the scaled image. </dd> 306 307<dd> </dd> 308<dt>filter</dt> 309<dd>Image filter to use. </dd> 310 311<dd> </dd> 312<dt>exception</dt> 313<dd>return any errors or warnings in this structure. </dd> 314 315<dd> </dd> 316</dl> 317<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="SampleImage">SampleImage</a></h2> 318 319<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> 320 321<p>The format of the SampleImage method is:</p> 322 323<pre class="text"> 324Image *SampleImage(const Image *image,const size_t columns, 325 const size_t rows,ExceptionInfo *exception) 326</pre> 327 328<p>A description of each parameter follows:</p> 329 330<dd> 331</dd> 332 333<dd> </dd> 334<dl class="dl-horizontal"> 335<dt>image</dt> 336<dd>the image. </dd> 337 338<dd> </dd> 339<dt>columns</dt> 340<dd>the number of columns in the sampled image. </dd> 341 342<dd> </dd> 343<dt>rows</dt> 344<dd>the number of rows in the sampled image. </dd> 345 346<dd> </dd> 347<dt>exception</dt> 348<dd>return any errors or warnings in this structure. </dd> 349 350<dd> </dd> 351</dl> 352<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="ScaleImage">ScaleImage</a></h2> 353 354<p>ScaleImage() changes the size of an image to the given dimensions.</p> 355 356<p>The format of the ScaleImage method is:</p> 357 358<pre class="text"> 359Image *ScaleImage(const Image *image,const size_t columns, 360 const size_t rows,ExceptionInfo *exception) 361</pre> 362 363<p>A description of each parameter follows:</p> 364 365<dd> 366</dd> 367 368<dd> </dd> 369<dl class="dl-horizontal"> 370<dt>image</dt> 371<dd>the image. </dd> 372 373<dd> </dd> 374<dt>columns</dt> 375<dd>the number of columns in the scaled image. </dd> 376 377<dd> </dd> 378<dt>rows</dt> 379<dd>the number of rows in the scaled image. </dd> 380 381<dd> </dd> 382<dt>exception</dt> 383<dd>return any errors or warnings in this structure. </dd> 384 385<dd> </dd> 386</dl> 387<h2><a href="http://www.imagemagick.org/api/MagickCore/resize_8c.html" id="ThumbnailImage">ThumbnailImage</a></h2> 388 389<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> 390 391<p>The format of the ThumbnailImage method is:</p> 392 393<pre class="text"> 394Image *ThumbnailImage(const Image *image,const size_t columns, 395 const size_t rows,ExceptionInfo *exception) 396</pre> 397 398<p>A description of each parameter follows:</p> 399 400<dd> 401</dd> 402 403<dd> </dd> 404<dl class="dl-horizontal"> 405<dt>image</dt> 406<dd>the image. </dd> 407 408<dd> </dd> 409<dt>columns</dt> 410<dd>the number of columns in the scaled image. </dd> 411 412<dd> </dd> 413<dt>rows</dt> 414<dd>the number of rows in the scaled image. </dd> 415 416<dd> </dd> 417<dt>exception</dt> 418<dd>return any errors or warnings in this structure. </dd> 419 420<dd> </dd> 421</dl> 422</div> 423 <footer class="magick-footer"> 424 <p><a href="../support.html">Donate</a> • 425 <a href="../sitemap.html">Sitemap</a> • 426 <a href="../links.html">Related</a> • 427 <a href="../architecture.html">Architecture</a> 428</p> 429 <p><a href="resize.html#">Back to top</a> • 430 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • 431 <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p> 432 <p><small>© 1999-2016 ImageMagick Studio LLC</small></p> 433 </footer> 434</div><!-- /.container --> 435 436 <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 437 <script src="../js/magick.html"></script> 438</div> 439</body> 440</html> 441