Back to Imagemagick

Resize

www/api/resize.html

7.1.2-216.4 KB
Original Source

Resize

Select API Method

AdaptiveResizeImage

AdaptiveResizeImage() adaptively resize image with pixel resampling.

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.

The format of the AdaptiveResizeImage method is:

Image \*AdaptiveResizeImage(const Image \*image,const size\_t columns, const size\_t rows,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. columnsthe number of columns in the resized image. rowsthe number of rows in the resized image. exceptionreturn any errors or warnings in this structure.

InterpolativeResizeImage

InterpolativeResizeImage() resizes an image using the specified interpolation method.

The format of the InterpolativeResizeImage method is:

Image \*InterpolativeResizeImage(const Image \*image,const size\_t columns, const size\_t rows,const PixelInterpolateMethod method, ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. columnsthe number of columns in the resized image. rowsthe number of rows in the resized image. methodthe pixel interpolation method. exceptionreturn any errors or warnings in this structure.

LiquidRescaleImage

LiquidRescaleImage() rescales image with seam carving.

The format of the LiquidRescaleImage method is:

Image \*LiquidRescaleImage(const Image \*image,const size\_t columns, const size\_t rows,const double delta\_x,const double rigidity, ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. columnsthe number of columns in the rescaled image. rowsthe number of rows in the rescaled image. delta_xmaximum seam transversal step (0 means straight seams). rigidityintroduce a bias for non-straight seams (typically 0). exceptionreturn any errors or warnings in this structure.

MagnifyImage

MagnifyImage() doubles the size of the image with a pixel art scaling algorithm.

The format of the MagnifyImage method is:

Image \*MagnifyImage(const Image \*image,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. exceptionreturn any errors or warnings in this structure.

MinifyImage

MinifyImage() is a convenience method that scales an image proportionally to half its size.

The format of the MinifyImage method is:

Image \*MinifyImage(const Image \*image,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. exceptionreturn any errors or warnings in this structure.

ResampleImage

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.

The format of the ResampleImage method is:

Image \*ResampleImage(Image \*image,const double x\_resolution, const double y\_resolution,const FilterType filter, ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image to be resized to fit the given resolution. x_resolutionthe new image x resolution. y_resolutionthe new image y resolution. filterImage filter to use. exceptionreturn any errors or warnings in this structure.

ResizeImage

ResizeImage() scales an image to the desired dimensions, using the given filter (see AcquireFilterInfo()).

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.

ResizeImage() was inspired by Paul Heckbert's "zoom" program.

The format of the ResizeImage method is:

Image \*ResizeImage(Image \*image,const size\_t columns,const size\_t rows, const FilterType filter,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. columnsthe number of columns in the scaled image. rowsthe number of rows in the scaled image. filterImage filter to use. exceptionreturn any errors or warnings in this structure.

SampleImage

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.

The format of the SampleImage method is:

Image \*SampleImage(const Image \*image,const size\_t columns, const size\_t rows,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. columnsthe number of columns in the sampled image. rowsthe number of rows in the sampled image. exceptionreturn any errors or warnings in this structure.

ScaleImage

ScaleImage() changes the size of an image to the given dimensions.

The format of the ScaleImage method is:

Image \*ScaleImage(const Image \*image,const size\_t columns, const size\_t rows,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. columnsthe number of columns in the scaled image. rowsthe number of rows in the scaled image. exceptionreturn any errors or warnings in this structure.

ThumbnailImage

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.

The format of the ThumbnailImage method is:

Image \*ThumbnailImage(const Image \*image,const size\_t columns, const size\_t rows,ExceptionInfo \*exception)

A description of each parameter follows:

imagethe image. columnsthe number of columns in the scaled image. rowsthe number of rows in the scaled image. exceptionreturn any errors or warnings in this structure.