---
title: "Shadow Class"
canonical: https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_Shadow.htm
product: "Graphics Mill"
---

# Shadow Class
 
Applies a shadow effect to an image.
 
**Namespace:** [Aurigma.GraphicsMill.Transforms](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Transforms.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public sealed class Shadow : Transform
```
 
## Remarks
  
When you apply this effect, the image drops a shadow with specified parameters (taking into account transparent areas of the image). This effect is ideal for creating artistic texts, logos, etc.
 
You can specify a number of shadow parameters. [HorizontalOffset](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Transforms_Shadow_HorizontalOffset.htm.md) and [VerticalOffset](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Transforms_Shadow_VerticalOffset.htm.md) specify offset of the shadow relatively the image. [Color](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Transforms_Shadow_Color.htm.md) means the shadow color. To make shadow looking more realistic, it is blurred. You can set blur [Radius](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Transforms_Shadow_Radius.htm.md) (amount of the shadow fuzziness). Property [EnlargeToFit](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Transforms_Shadow_EnlargeToFit.htm.md) can be used to specify if the transform should increase size of the image to fit the shadow or it should truncate the shadow which is out of the original image (makes sense to set it to `true` when you create artistic thumbnails).
 
**Note** 
If the bitmap does not have an alpha channel (e.g. its pixel format is [Format24bppRgb](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_PixelFormat_Format24bppRgb.htm.md)), alpha channel is automatically added. So be aware that pixel format of the output bitmap may differ from the input one.
 
## Examples
  
The following code gets the thumbnail from an image EXIF metadata, applies the Shadow transform on it, and saves the result:
 
```csharp
using (var jpegReader = new JpegReader(@"Images\in.jpg"))
{
    using (var thumbnail = (Bitmap)(jpegReader.Exif[ExifDictionary.Thumbnail]))
    {
        //Add the alpha channel
        if (!thumbnail.HasAlpha)
            thumbnail.Channels.SetAlpha(1);

        //Apply Shadow transform
        thumbnail.Transforms.Shadow(RgbColor.Black, 4, 4, 10, true);

        //Flatten alpha channel
        thumbnail.Channels.RemoveAlpha(RgbColor.White);
        thumbnail.Save(@"Images\out.jpg");
    }
}
```
 
## Inheritance Hierarchy
  
- System.Object
    - [Aurigma.GraphicsMill.PipelineElement](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_PipelineElement.htm.md)
        - [Aurigma.GraphicsMill.Transforms.Transform](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_Transform.htm.md)
            - Aurigma.GraphicsMill.Transforms.Shadow
 
## Thread Safety
 Static members of this type are not safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.
   
## See Also

### Reference

- [Shadow Members](https://www.graphicsmill.com/docs/gm/AllMembers_T_Aurigma_GraphicsMill_Transforms_Shadow.htm.md)
- [Aurigma.GraphicsMill.Transforms Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Transforms.htm.md)
