# Process Image

Process images using DsImaging such as resize, crop, rotate, flip, change image resolution, convert to indexed, combine, composite, blend, ICC profile and more.

## Content

DsImaging allows you to process images in different ways, such as alter the image size, crop, rotate, flip image, and change image resolution. It provides various properties and methods, such as Resize, FlipRotate, etc. in the [GcBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.html) class to handle such type of processing.

## Resize Image

DsImaging lets you reduce or enlarge an image using [Resize](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.Resize.html) method of the **GcBitmap** class. The **Resize** method takes **InterpolationMode** as a parameter to generate the transformed image which is stored as a GcBitmap instance. The interpolation parameter can be set using the [InterpolationMode](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Drawing.InterpolationMode.html) enumeration which specifies the algorithm used to scale images.

| **Original Image** | **Image with reduced size** | **Enlarged image** |
| -------------- | ----------------------- | -------------- |
| ![Image of two birds sitting by the side](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/puffins-large.png) | ![image](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/image.b16325.png) | ![image](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/image.9c3104.png) |

To resize an image:

1. Initialize the **GcBitmap** class.
2. Load an image in the GcBitmap instance.
3. Calculate the new height and width of the image for scaling the image.
4. Invoke the **Resize** method of GcBitmap class with new height, width, and interpolation mode as its parameters.

    ```csharp
    //Get the image path
    var origSmallImagePath = Path.Combine("Resources", "Images",
                             "puffins-small.jpg");
    
    //Initialize GcBitmap
    GcBitmap origLargeBmp = new GcBitmap();
    GcBitmap origSmallBmp = new GcBitmap();
    
    //Load image from file
    origLargeBmp.Load(origSmallImagePath);
    origSmallBmp.Load(origSmallImagePath);
    
    //Reduce image 
    int rwidth = origLargeBmp.PixelWidth - 564;
    int rheight = origLargeBmp.PixelHeight - 376;
    GcBitmap smallBmp = origLargeBmp.Resize(rwidth, rheight,
                        InterpolationMode.Linear);
    
    //Enlarge image
    int ewidth = origSmallBmp.PixelWidth + 156;
    int eheight = origSmallBmp.PixelHeight + 54;
    GcBitmap largeBmp = origSmallBmp.Resize(ewidth, eheight,
                        InterpolationMode.Linear);
    
    //Save scaled image to file
    smallBmp.SaveAsJpeg("puffins-scale-small.jpg");
    largeBmp.SaveAsJpeg("puffins-scale-large.jpg");
    ```

## Crop Image

Image cropping is usually done to remove the extraneous part of an image in order to improve its framing, to change the aspect ratio and to isolate a particular object from its background. DsImaging allows you to crop an image using [Clip](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.Clip.html) method of the GcBitmap class. This method creates new GcBitmap instance that stores the cropped fragment of the original image.

| **Original Image** | **Cropped Image** |
| -------------- | ------------- |
| ![Image of fruits and vegetables](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/color-vegetables.png) | ![Cropped image of fruits and vegetables](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/cropped-color-vegetables.png) |

To crop an image:

1. Load an image in the GcBitmap instance.
2. Define a rectangle with specified location and size which is to be cropped.
3. Invoke the **Clip** method of GcBitmap class while specifying the rectangle to separate the required image fragment from the original image.

    ```csharp
    //Get the image path
    var origImagePath = Path.Combine("Resources", "Images", 
                        "color-vegetables.jpg");
    
    //Initialize GcBitmap
    GcBitmap origBmp = new GcBitmap();
    
    //Load image from file
    origBmp.Load(origImagePath);
    
    //Crop image
    Rectangle clipRec = new Rectangle(661, 327, 508, 878);
    GcBitmap clipbmp = origBmp.Clip(clipRec);
    
    //Save cropped image to file
    clipbmp.SaveAsJpeg("color-vegetables-crop.jpg");
    ```

## Rotate and Flip Image

An image can be rotated at different angles and flipped to create its mirror image. DsImaging supports both rotation and flipping of an image through [FlipRotate](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.FlipRotate.html) method of the GcBitmap class. This method accepts a parameter of type [FlipRotateAction](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.FlipRotateAction.html) enumeration which specifies flip and rotation transformations. Using **FlipRotateAction** enumeration, an image can be rotated clockwise at 90, 180, or 270 degrees and flipped horizontally or vertically. The enumeration also provides an option to flip an image horizontally with a clockwise rotation of 90 or 270 degrees.

| **Original Image** | **Rotated Image** | **Flipped Image** |
| -------------- | ------------- | ------------- |
| ![Image of fruits and vegetables](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/color-vegetables.png) | ![image](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/image.380369.png) | ![image](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/image.5a0b80.png) |

To rotate an image clockwise at 90 degree:

1. Load an image in a GcBitmap instance.
2. Call the **FlipRotate** method of GcBitmap class while specifying the FlipRotateAction to produce an image rotated clockwise at 90 degrees.

    ```csharp
    //Get the image path
    var origImagePath = Path.Combine("Resources", "Images",
                        "color-vegetables.jpg");
    
    //Initialize GcBitmap
    GcBitmap origBmp = new GcBitmap();
    
    //Load image from file
    origBmp.Load(origImagePath);
    
    //Rotate image by 90 degree
    GcBitmap rotatebmp = origBmp.FlipRotate(FlipRotateAction.Rotate90);
    
    //Save rotated image to file
    rotatebmp.SaveAsJpeg("color-vegetables-rotate.jpg");
    ```

To flip an image horizontally:

1. Load an image in a GcBitmap instance.
2. Call the **FlipRotate** method of GcBitmap class while specifying the FlipRotateAction to flip the pixels around the vertical y-axis which produces a mirror image.

    ```csharp
    //Get the image path
    var origImagePath = Path.Combine("Resources", "Images",
                        "color-vegetables.jpg");
    
    //Initialize GcBitmap
    GcBitmap origBmp = new GcBitmap();
    
    //Load image from file
    origBmp.Load(origImagePath);
    
    //Flip image horizontally
    GcBitmap flipbmp = origBmp.FlipRotate(FlipRotateAction.FlipHorizontal);
    
    //Save image to file
    flipbmp.SaveAsJpeg("color-vegetables-flip.jpg");
    ```

## Clear Image

In DsImaging, you can remove text and graphics from GcBitmap using [Clear](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.Clear.html) method of the GcBitmap class. It leaves a specified color on the surface.

```csharp
//Initialize GcBitmap with the expected height/width
var origBmp = new GcBitmap(pixelWidth, pixelHeight, true, dpiX, dpiY);

//Clear image
origBmp.Clear(Color.LightBlue);

//Save image to file
origBmp.SaveAsJpeg("color-vegetables-clear.jpg");
```

## Change Resolution

Resolution of an image refers to the measurement of its output quality. DsImaging allows you to change the resolution of an image using [SetDpi](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.SetDpi.html) method of the GcBitmap class. The **SetDpi** method has following two overloads, **SetDpi(float dpi)** and **SetDpi (float dpiX, float dpiY)**. The **SetDpi(float dpi)** method allows you to change the physical resolution of an image by accepting a single value for the horizontal and vertical resolution. On the other hand, the **SetDpi (float dpiX, float dpiY)** method lets you change the physical resolution of an image by accepting separate values for the horizontal and the vertical resolution.
Additionally, GcBitmap class provides two properties, namely DpiX and DpiY, using which you can fetch the horizontal and vertical resolution of the bitmap, respectively.
To change the resolution of an image:

1. Load an image from file in the GcBitmap instance.
2. Invoke the **SetDpi** method of GcBitmap class which accepts the new horizontal and vertical resolution as its parameters.

    ```csharp
    //Get the image path
    var origImagePath = Path.Combine("Resources", "Images",
                        "color-vegetables.jpg");
    
    //Initialize GcBitmap
    GcBitmap origBmp = new GcBitmap();
    
    //Load image from file
    origBmp.Load(origImagePath);
    
    //Change image resolution
    int newDpiX = 200, newDpiY = 400;
    origBmp.SetDpi(newDpiX, newDpiY);
    
    //Save image to file
    origBmp.SaveAsJpeg("color-vegetables-resolution.jpg");
    ```

## Convert to Indexed Image

DsImaging supports high quality ARGB images. However, such high quality images take more memory than the indexed images. Hence, you can convert the ARGB images to indexed images to store them compactly. DsImaging provides two methods to convert ARGB images to indexed images, which are [ToIndexed4bppBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.ToIndexed4bppBitmap.html) and [ToIndexed8bppBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap.html) of the GcBitmap class. The **ToIndexed4bppBitmap** method converts an image to 4 bpp (bits per pixel) indexed image which returns an instance of the [Indexed4bppBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.Indexed4bppBitmap.html) class. Similarly, **ToIndexed8bppBitmap** method converts an image to 8 bpp indexed image which returns an instance of [Indexed8bppBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.Indexed8bppBitmap.html) class. The ToIndexed4bppBitmap and ToIndexed8bppBitmap methods can take any custom palette as a parameter while converting an image to the indexed image.

| **Original Image** | **Indexed Image** |
| -------------- | ------------- |
| ![Image of a peacock with blue and geen color](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/peacock_small.jpg) | ![Indexed image of a peacock with blue and geen color](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/indexedpeacockpal1.jpg) |

To convert an image to a 4bpp indexed image using the octree color palette based on the Octree color quantization algorithm:

1. Load an image in the GcBitmap instance.
2. Generate the Octree color palette by using [GenerateOctreePalette](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.GenerateOctreePalette.html) method of GcBitmap class.
3. Convert the image to 4 bpp using **ToIndexed4bppBitmap** method  of GcBitmap class and pass the octree color palette as its parameter.
4. Save the indexed image using the [SaveAsJpeg](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.SaveAsJpeg.html) method.

    ```csharp
    //Load an image to generate a custom palette
    GcBitmap bmpSrc = new GcBitmap();
    bmpSrc.Load("Images/peacock_small.jpg");
    
    //Generate color palette using Octree quantizer and dithering
    var pal = bmpSrc.GenerateOctreePalette(16);
    
    //Use octree palette generated above as a custom palette to create an Indexed image
    Indexed4bppBitmap ind = bmpSrc.ToIndexed4bppBitmap(pal, DitheringMethod.FloydSteinberg);            
    ind.ToGcBitmap().SaveAsJpeg("Images/IndexedPeacockpal1.jpg");
    ```

## Combine Images

DsImaging allows you to combine multiple images with different formats to generate a new image. You can combine multiple images and place them on one GcBitmap using [BitBlt](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.BitBlt.html) method of the GcBitmap class. The BitBlt method performs a bit-block transfer of the color data corresponding to pixels from the specified source bitmap into the current bitmap.
To combine multiple images, say four images, with different formats into a new image:

1. Create GcBitmap instances for each image.
2. Load an image in each GcBitmap instance.
3. Initialize a new GcBitmap instance with specified width and height, in pixel, to combine all the four images into one.
4. Place all the images one by one with specified coordinates on this GcBitmap by performing bit-block transfer using **BitBlt** method of the GcBitmap class.

    ```csharp
    //Get the images paths
    var jpgImagePath = Path.Combine("Resources", "Images",
                       "gray-puffins-small.jpg");
    var pngImagePath = Path.Combine("Resources", "Images",
                       "gray-dog-small.png");
    var bmpImagePath = Path.Combine("Resources", "Images",
                       "color-goldfish-small.bmp");
    var gifImagePath = Path.Combine("Resources", "Images",
                       "peacock-small.gif");
    
    //Initialize GcBitmap instances and load an image in each instance
    GcBitmap jpgBmp = new GcBitmap();
    jpgBmp.Load(jpgImagePath);
    jpgBmp.Opaque = true;
    
    GcBitmap pngBmp = new GcBitmap();
    pngBmp.Load(pngImagePath);
    pngBmp.Opaque = true;
    
    GcBitmap bmpBmp = new GcBitmap();
    bmpBmp.Load(bmpImagePath);
    bmpBmp.Opaque = true;
    
    GcBitmap gifBmp = new GcBitmap();
    gifBmp.Load(gifImagePath);
    gifBmp.Opaque = true;
    
    //Concatenate the images with different formats to 
    //generate a new image
    int w = jpgBmp.PixelWidth + 1;
    int h = jpgBmp.PixelHeight + 1;
    GcBitmap outBmp = new GcBitmap(w * 2, h * 2, true);
    outBmp.BitBlt(jpgBmp, 0, 0);
    outBmp.BitBlt(pngBmp, w, 0);
    outBmp.BitBlt(bmpBmp, 0, h);
    outBmp.BitBlt(gifBmp, w, h);
    
    //Save concatenated image to file
    outBmp.SaveAsJpeg("color-concatenate.jpg");
    ```

## Compositing Images

Compositing defines various ways in which two bitmaps can be combined into a single image. DsImaging allows you to composite images using Porter-Duff compositing algorithm by providing [CompositeAndBlend](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.CompositeAndBlend.html) method in the GcBitmap class. The method takes values from [CompositeMode](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.CompositeMode.html) enumeration as a parameter to generate the resultant image by compositing the source and destination bitmap. There are 13 composite modes which can be implemented through the **CompositeMode** enumeration as displayed below:

| **Source Image** | **Destination Image** |
| ------------ | ----------------- |
| ![source image of shapes](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/src.png?width=250) | ![destination image of shapes](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/dst.png?width=250) |

| **Clear** | **Copy** | **Destination** | **Source Over** | **Destination Over** |
| ----- | ---- | ----------- | ----------- | ---------------- |
| ![Combined source and destination image using clear composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_clear.png?width=250) | ![Combined source and destination image using copy composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_copy.png?width=250) | ![Combined source and destination image using destination composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_destination.png?width=250) | ![Combined source and destination image using source over composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_sourceover.png?width=250) | ![Combined source and destination image using destination over composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_destinationover.png?width=250) |
| **Source In** | **Destination In** | **Source Out** | **Destination Out** | **Source Atop** |
| ![Combined source and destination image using source in composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_sourcein.png?width=250) | ![Combined source and destination image using destination in composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_destinationin.png?width=250) | ![Combined source and destination image using source out composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_sourceout.png?width=250) | ![Combined source and destination image using destination out composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_destinationout.png?width=250) | ![Combined source and destination image using source atop composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_sourceatop.png?width=250) |
| **Destination Atop** | **XOR** | **Lighter** |
| ![Combined source and destination image using destination atop composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_destinationatop.png?width=250) | ![Combined source and destination image using XOR composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_xor.png?width=250) | ![Combined source and destination image using lighter composite mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/res_lighter.png?width=250) |

To perform Porter-Duff compositing on two bitmaps using DestinationOver composite mode :

1. Create GcBitmap instances to load the source and destination images.
2. Invoke the **CompositeAndBlend** method of GcBitmap class, and pass the **DestinationOver** composite mode as the parameter to combine the two images.

    ```csharp
    //Load the two images to be combined
    using (var dst = new GcBitmap(@"in\dst.png"))
    using (var src = new GcBitmap(@"in\src.png"))
    //Combine the two images using various compositing and blending modes
    {
        var tmp = dst.Clone();
        tmp.CompositeAndBlend(src, 0, 0, CompositeMode.DestinationOver);
        tmp.SaveAsPng(@"out\res_DestinationOver.png");
    
    }
    ```

## Blend Modes

Blend mode determines how the colors of the target image and the colors of graphic primitives or images that are drawn on the target are mixed (blended) with each other. The [BlendMode](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Drawing.BlendMode.html) enumeration is used to specify the blend mode. In DsImaging, the blend mode can be specified in two ways:

* By setting the **BlendMode** property on the current instance of the **GcBitmapGraphics** class or directly on the **GcBitmap.Renderer** (the two properties are associated with the same value internally). In this case the specified blend mode will affect all subsequent drawing on the bitmap until changed to a different value.
* By specifying a blend mode value as a parameter of the [CompositeAndBlend](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.CompositeAndBlend.html) method of GcBitmap. In this case the specified blend mode will only apply to the current method call. This approach is preferable if you only need to overlay two images, and also provides other useful options.

The following example shows how the BlendMode property can be used to affect all drawing on a GcBitmapGraphics:

```csharp
// Use the spectrum image as the background to draw on:
using var bmp = new GcBitmap("spectrum-pastel-500x500.png");
using var g = bmp.CreateGraphics();

// Draw text on the spectrum background using a few blend modes:
var rc = new RectangleF(0, 0, bmp.PixelWidth / 2, bmp.PixelHeight / 2);
var tf = new TextFormat() { FontSize = 24, FontBold = true, ForeColor = Color.Gray };
var modes = new BlendMode[]
    { BlendMode.Multiply, BlendMode.Screen, BlendMode.ColorBurn, BlendMode.ColorDodge };
var pts = new PointF[]
    { new PointF(0, 0), new PointF(250, 0), new PointF(-250, 250), new PointF(250, 0) };
int i = 0;
foreach (var mode in modes)
{
    g.BlendMode = mode;
    rc.Offset(pts[i++]);
    g.DrawString($"This text is drawn using {g.BlendMode} blend mode.",
        tf, rc, TextAlignment.Center, ParagraphAlignment.Center);
    var rcb = rc;
    rcb.Inflate(-2, -2);
    g.DrawRectangle(rcb, Color.Red);
}
bmp.SaveAsPng("blend-modes.png");
}
```

The output of the above code will look like below:
![](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/blend-modes.png)
To use the **CompositeAndBlend** method, you need to create two instances of **GcBitmap**. One will be the target of the operation containing the backdrop on which to draw. The second bitmap (source) should contain the image that will be blended with the target. You will also need to also specify the **CompositeMode** and other parameters. The following code shows an example:

```csharp
//Load the two images to be combined
GcBitmap ducky = new GcBitmap("Images/ducky.png");
GcBitmap spectrum = new GcBitmap("Images/spectrum.png");        

//Combine the two images using various compositing and blending modes
spectrum.CompositeAndBlend(ducky, 0, 0, CompositeMode.SourceOver, BlendMode.ColorDodge);
spectrum.SaveAsPng("BlendDucky.png");
```

| **Source Image** | **Destination Image** |
| ------------ | ----------------- |
| ![Image of a yellow duck](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/ducky.png?width=150) | ![Image of a spectrum of various colors](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/spectrum.png?width=150) |

| **Normal** | **Multiply** | **Screen** | **Overlay** |
| ------ | -------- | ------ | ------- |
| ![Blended image of duck and spectrum with normal blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm1.png?width=150) | ![Blended image of duck and spectrum with multiply blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm2.png?width=150) | ![Blended image of duck and spectrum with screen blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm3.png?width=150) | ![Blended image of duck and spectrum with overlay blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm4.png?width=150) |
| **Darken** | **Lighten** | **Color Dodge** | **ColorBurn** |
| ![Blended image of duck and spectrum with darken blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm5.png?width=150) | ![Blended image of duck and spectrum with lighten blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm6.png?width=150) | ![Blended image of duck and spectrum with color dodge blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm7.png?width=150) | ![Blended image of duck and spectrum with color burn blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm8.png?width=150) |
| **Hard Light** | **Soft Light** | **Difference** | **Exclusion** |
| ![Blended image of duck and spectrum with hard light blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm9.png?width=150) | ![Blended image of duck and spectrum with soft light blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm10.png?width=150) | ![Blended image of duck and spectrum with difference blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm11.png?width=150) | ![Blended image of duck and spectrum with exclusion blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm12.png?width=150) |
| **Hue** | **Saturation** | **Color** | **Luminosity** |
| ![Blended image of duck and spectrum with hue blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm13.png?width=150) | ![Blended image of duck and spectrum with saturation blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm14.png?width=150) | ![Blended image of duck and spectrum with color blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm15.png?width=150) | ![Blended image of duck and spectrum with luminosity blend mode](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/bm16.png?width=150) |

## Support for ICC Profiles

ICC profile is a color management standard for specifying the color attributes of imaging devices. It ensures that the colors of an image are correctly displayed over different devices. In DsImaging library, the ICC profile is handled as binary data and can be extracted or embedded using [IccProfileData](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.IccProfileData.html) property of **GcBitmap** class. The ICC profile is supported for various image formats such as, JPEG, PNG, TIFF and GIF.
To extract ICC profile of an image and embed it to another image:

1. Load an image in the GcBitmap instance.
2. Get the ICC profile of an image from the **IccProfileData** property of GcBitmap class.
3. Load another image in the GcBitmap instance to which you want to apply the ICC profile.
4. Assign the ICC profile of first image to this image using the **IccProfileData** property of GcBitmap class.

    ```csharp
    //Get the ICCProfileData for an image and set it to another image
    GcBitmap bmp = new GcBitmap();
    bmp.Load("Images/peacock-small.jpg");
    var peacockICC_Data = bmp.IccProfileData;
    Console.WriteLine($"ICC Profile of peacock image consists of {bmp.IccProfileData.Length} bytes");
    
    bmp.Load("Images/puffins-small.jpg");          
    bmp.IccProfileData = peacockICC_Data;
    Console.WriteLine($"ICC Profile of peacock image copied to puffins image which now consists of {bmp.IccProfileData.Length} bytes");
    ```

For more information about processing images using DsImaging, see [DsImaging sample browser](https://developer.mescius.com/documents-api-imaging/demos/basics/miscellaneous/blending-modes/code-cs).

> !type=note
> **Note**: For rendering large or complex text and graphics, you can use [Skia](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging.Skia/GrapeCity.Documents.Imaging.Skia.html) library. For more information about the library and its usage, see [Render using Skia Library](/document-solutions/dot-net-imaging-api/docs/online/render-using-skia).
