## gimpimagetransform

gimpimagetransform — Transformations on images.

## Functions

gboolean | gimp_image_resize ()
gboolean | gimp_image_resize_to_layers ()
gboolean | gimp_image_scale ()
gboolean | gimp_image_scale_full ()
gboolean | gimp_image_crop ()
gboolean | gimp_image_flip ()
gboolean | gimp_image_rotate ()

## Description

Operations to scale, resize, crop, flip and rotate images.

## Functions

### gimp_image_resize ()

    gboolean
    gimp_image_resize (gint32 image_ID,
                       gint new_width,
                       gint new_height,
                       gint offx,
                       gint offy);

Resize the image to the specified extents.

This procedure resizes the image so that it's new width and height are equal to the supplied parameters. Offsets are also provided which describe the position of the previous image's content. All channels within the image are resized according to the specified parameters; this includes the image selection mask. All layers within the image are repositioned according to the specified offsets.

#### Parameters

image_ID | The image. |
new_width | New image width. |
new_height | New image height. |
offx | x offset between upper left corner of old and new images: (new - old). |
offy | y offset between upper left corner of old and new images: (new - old). |

#### Returns

TRUE on success.

### gimp_image_resize_to_layers ()

    gboolean
    gimp_image_resize_to_layers (gint32 image_ID);

Resize the image to fit all layers.

This procedure resizes the image to the bounding box of all layers of the image. All channels within the image are resized to the new size; this includes the image selection mask. All layers within the image are repositioned to the new image area.

#### Parameters

image_ID | The image. |

#### Returns

TRUE on success.

Since: 2.2

### gimp_image_scale ()

    gboolean
    gimp_image_scale (gint32 image_ID,
                      gint new_width,
                      gint new_height);

Scale the image using the default interpolation method.

This procedure scales the image so that its new width and height are equal to the supplied parameters. All layers and channels within the image are scaled according to the specified parameters; this includes the image selection mask. The interpolation method used can be set with `gimp_context_set_interpolation()`.

#### Parameters

image_ID | The image. |
new_width | New image width. |
new_height | New image height. |

#### Returns

TRUE on success.

### gimp_image_scale_full ()

    gboolean
    gimp_image_scale_full (gint32 image_ID,
                           gint new_width,
                           gint new_height,
                           GimpInterpolationType interpolation);

`gimp_image_scale_full` is deprecated and should not be used in newly-written code.

Use `gimp_image_scale()` instead.

#### Parameters

image_ID | The image. |
new_width | New image width. |
new_height | New image height. |
interpolation | Type of interpolation. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_image_crop ()

    gboolean
    gimp_image_crop (gint32 image_ID,
                     gint new_width,
                     gint new_height,
                     gint offx,
                     gint offy);

Crop the image to the specified extents.

This procedure crops the image so that it's new width and height are equal to the supplied parameters. Offsets are also provided which describe the position of the previous image's content. All channels and layers within the image are cropped to the new image extents; this includes the image selection mask. If any parameters are out of range, an error is returned.

#### Parameters

image_ID | The image. |
new_width | New image width: (0 < new_width <= width). |
new_height | New image height: (0 < new_height <= height). |
offx | X offset: (0 <= offx <= (width - new_width)). |
offy | Y offset: (0 <= offy <= (height - new_height)). |

#### Returns

TRUE on success.

### gimp_image_flip ()

    gboolean
    gimp_image_flip (gint32 image_ID,
                     GimpOrientationType flip_type);

Flips the image horizontally or vertically.

This procedure flips (mirrors) the image.

#### Parameters

image_ID | The image. |
flip_type | Type of flip. |

#### Returns

TRUE on success.

### gimp_image_rotate ()

    gboolean
    gimp_image_rotate (gint32 image_ID,
                       GimpRotationType rotate_type);

Rotates the image by the specified degrees.

This procedure rotates the image.

#### Parameters

image_ID | The image. |
rotate_type | Angle of rotation. |

#### Returns

TRUE on success.