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