This documentation is for the old version. Go to the latest Graphics Mill docs

Core Class Library

The Graphics Mill for .NET core class library contains classes implementing all imaging functionality (loading/saving images, applying effects, transforms, drawing, etc).

Load and Save Images

Graphics Mill for .NET supports the following file formats:

  • JPEG, PNG, GIF, WBMP, TIFF, BMP, JPEG2000 (both read and write). Can read and write multipage TIFF and animated GIF files;
  • PCX, PSD (read only);
  • PDF, SWF (write only). Can write animated SWF files and multipage PDF files;
Note

There are also available Graphics Mill for .NET add-ons which will give additional format support:

Images can be loaded not only from files, but also from sources. This way you can load images from databases, memory, URL, etc.

The essential feature of Graphics Mill for .NET is the possibility to extract thumbnails in a fast and memory-friendly way. It is achieved by generating thumbnails on-the-fly, while the file is read. For example if you are generating a 100x100 thumbnail from a 4000x4000 image, Graphics Mill for .NET allows you to avoid occupying 64 megabytes (as would happen if you first loaded the image, then resized it). It can create a thumbnail while reading the image from the file, so you will never commit extra memory.

Alternatively, you can load (as well as save) not pixels, but EXIF, IPTC, XMP, and Adobe® image resource blocks metadata collections from files. In particular, this allows to extract thumbnails from files even faster than on-the-fly technique described above.

One more great feature is the possibility to process uncompressed JPEG files. In particular, you can:

  • Rotate and Flip without loss.
  • Recompress only a part of a JPEG file. E.g. if you put a watermark on the image, you can recompress only the part of the JPEG file which was changed and leave the rest intact.
  • Edit EXIF, IPTC, and XMP fields and Adobe® image resource blocks without JPEG recompression.

When saving animated GIF files, you can enable optimization. Whenever possible, it will crop out the same portions of two neighbour frames, and this way highly reduce the output GIF file size. Another way of optimization is casting all frames palettes to a single global palette.

And at last, even if you need some extra file formats to be supported, Graphics Mill for .NET exposes API which enables you to implement your own codec which will be closely integrated into Graphics Mill for .NET.

Natural Pixel Formats

Graphics Mill for .NET allows you to load and save images in their natural pixel formats: 1, 4, 8, 16, 24, 32, 40, 48, 64, 80 bits per pixel. So if you load a 1-bit image, it won't be converted to a 32-bit image ( thus occupying 32 times more memory);

Most effects can be applied directly to RGB, Grayscale and CMYK image without any conversion. It not only prevents wasting of extra resources, but preserves the image from degradation.

Another important feature of Graphics Mill for .NET is that it supports extended pixel formats, i.e. 16 bits per channel.

Advanced Color Management

To be sure that the hardcopy image will have the same colors as the image file, you need to apply color management. Graphics Mill for .NET allows to do it as easily as possible. The following features are available:

  • Loading and saving embedded ICC profiles in files;
  • Conversion between color spaces (RGB, CMYK and Grayscale) based on ICC profiles;
  • Conversion of not only bitmaps, but also individual colors;
  • Display of image on screen using a device profile. Possibility to use two profiles together (to see on the current device what the image will look like on the target device);
  • Specifying rendering intent and possibility to use black point compensation algorithm to preserve image contrast after conversion;
  • Extraction of the color profile information;

Color Reduction

Color reduction is a process of converting TrueColor images into the images with 2-256 colors (i.e. indexed images). It consists of two subtasks - palette generation and the conversion itself. Graphics Mill for .NET excellently resolves both of them.

With Graphics Mill for .NET you can:

  • Generate adaptive palette using Octree algorithm;
  • Use one of predefined palettes:
    • Windows;
    • Macintosh;
    • Web Safe;
    • Adaptive;
  • Use custom palette;

When the conversion is starts, a special technique called dithering is used to reduce halftone "washing out". Graphics Mill for .NET supports the following dithering modes:

  • Error Diffusion (8 algorithms - Floyd Steinberg, Fan, Jarvis, Original, Stucki, Sierra, Burkes, and Stephenson);
  • Ordered Dithering (2 algorithms - Bayers and spiral);
  • White Noise;

The transparency information can be preserved when you reduce colors.

Imaging Operations

Graphics Mill for .NET allows you to apply different imaging operations. You can apply geometry transforms:

  • Resize (12 interpolation algorithms, including Scale-To-Gray for 1-bit images displaying, and Scale-To-Color for color indexed bitmaps);
  • Rotate (precise rotation on small angle, antialising, fast rotation on 90, 180 and 270 degrees);
  • Arbitrary affine and projective transforms (e.g. skew, perspective, etc.);
  • Crop;
  • Flip;
  • Swirl;
  • Wave;
  • WaterDrop;
  • Cylindrize;

You can also apply tone and color adjustment algorithms:

  • Hue/Saturation/Lightness correction;
  • Brightness correction (both automatic and manual);
  • Contrast correction (both automatic and manual);
  • Levels tone correction (both automatic and manual);
  • Curves tone correction;
  • Custom LUT;
  • Histogram equalization;
  • Channel balance;
  • Desaturation;

Use different filters:

  • Blur (Gaussian blur and fast implementation);
  • Edge Detect;
  • Maximum Filter (also known as Erosion);
  • Median Filter;
  • Minimum Filter (also know as Dilation);
  • Sharpen;
  • Unsharp Mask;

Apply artistic effects:

  • Waddle;
  • Add Noise (with uniform and Gaussian distribution);
  • Buttonize (with 3 diffrent button types);
  • Emboss;
  • Glow;
  • Mosaic;
  • Page Curl;
  • Shadow;
  • Solarize;
  • Invert;
  • Spray;
  • Texturize (neighbour images are connected seamlessly).
Note

There is also available a separate module - Red-Eye Removal which exposes red-eye effect removal functionality (including unique semiautomatic mode).

You can apply effects and color/tone adjustments to a part of the image using a rectangle or a raster mask.

You can also combine images with full support of alpha channel and various combine modes (such as Alpha, Add, Xor, Substract, Texturize, Screen, Overlay and others - total 22 modes). Overall opacity can be specified.

To get statistics about the bitmap you can generate a histogram. Analyzing the histogram you can estimate whether the image is too bright, too dark, or has too low a contrast.

If standard imaging algorithms implemented in Graphics Mill for .NET are not enough for you, you can create your own effects. It becomes easy because Graphics Mill for .NET provides low level access to pixel data.

Multithreading Support

Graphics Mill for .NET provides a possibility to create multithreaded user interface. It supports classes from the System.Threading namespace that makes it much easier to use. In short, it has the following multithreading features:

  • Thread safety of most Graphics Mill classes;
  • Possibility to run all the operations in asynchronous mode.

Drawing

Graphics Mill for .NET provides powerful drawing features.

  • Close integration with GDI+. You can draw high quality graphics on Aurigma.GraphicsMill.Bitmap using classes from System.Drawing namespace.
  • The class which is an analogue for System.Drawing.Graphics class but which is based on GDI. This way you can provide extremely high speed of drawing without having to import Win32API functions and structures, or getting into DirectX. It allows to:
    • Draw lines, curves (bezier splines, arcs), shapes (rectangles, ellipses, polygons, pies);
    • Use various pens to outline shape (you can specify width, color, style, etc.);
    • Use various brushes to fill shapes (you can change color, specify whether brush hatched and so on);
    • Draw text with True Type, Type1 and OpenType fonts. Text can be both single-line and multi-line with automatic words wrapping, clipping, adding ellipsis, etc;
    • Retrieve font metrics (ascent, descent, internal and external leading, etc);
    • Measure text string, get individual character position in the text, etc;
    • Draw outlined text;
    • Set affine transformation when some graphics is drawn (rotate, scale, shear);
    • Set clipping region when drawing something.