- About Graphics Mill
- What's New?
- Breaking Changes in Graphics Mill 12
- Breaking Changes in Graphics Mill 11
- Features
- Supported File Formats
- System Requirements
- Getting Started
- Working with Image Formats
- Transforming Images (Resize, Rotate, Crop)
- Working with Metadata
- Color Management and Color Reduction
- Drawing Text and Graphics
- Color Keying (Green Screen Removal)
- Channels and Pixel Data
- Color and Tone Correction
- Working with Photoshop (PSD) Files
- Image Filters
- Processing Large Images
- Basics of Image Processing
- Troubleshooting
- Class Library Reference
- Licensing
- End User License Agreement
- Copyright Notices
Transforming Images (Resize, Rotate, Crop)
This section is designed to give a detailed explanation on how to perform geometrical raster transformations with Graphics Mill. The section examines such transformations as rotating, flipping, resizing, cropping, and affine/projective transformations using matrices. If you are working with JPEG format and want to apply the transformations without diminishing the image's quality, see the Applying Lossless JPEG Transforms topic.
Image transformation operations in Graphics Mill can be performed in two ways: in-place and out-of-place. The main difference is that in-place operations change the source bitmap, while out-of-place operations create a new one. All in-place transformations are realized through the TransformsProvider class and can be implemented via the Bitmap.Transforms property. To implement an out-of-place operation you should utilize the related class from the Aurigma.GraphicsMill.Transforms namespace, for example, the Transforms.Resize class.
For in-place resize transformation, note that the source bitmap is changed:
using (var bitmap = new Bitmap(@"Images\in.jpg"))
{
bitmap.Transforms.Resize(100, 0);
bitmap.Save(@"Images\Output\out.jpg");
}
For out-of-place resize transformation, note that the new resized bitmap is created, while the source bitmap remains unchanged:
using (var bitmap = new Bitmap(@"Images\in.jpg"))
using (var resize = new Resize(100, 0))
{
using (var result = resize.Apply(bitmap))
{
result.Save(@"Images\Output\out.jpg");
}
}
In This Section
Resizing and Cropping Images
Rotating and Flipping Images
Affine and Projective Transformations