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