---
title: "JpegWriter Class"
canonical: https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_JpegWriter.htm
product: "Graphics Mill"
---

# JpegWriter Class
 
Contains methods and properties used to write JPEG images.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public sealed class JpegWriter : ImageWriter, IMetadataWriter
```
 
## Remarks
  
JPEG (Joint Photographic Experts Group) is the most popular bitmap image format for storing digital photos using lossy compression. The JPEG format was designed for compressing either grayscale or full-color images of real-world scenes. It supports the sequential and progressive compression schemes, subsampling, and setting a quality range from 0 to 100.
 
JPEG files can also contain Adobe® resources, XMP, EXIF and IPTC data. However it does not support multiple images in the single file.
 
JPEG images support three main color spaces:
 
- RGB;
- CMYK;
- Grayscale;

It does not support indexed images, as well as extended (16 bit per channel) pixel formats.
 
## Examples
  
The following code saves JPEG file with the quality value set to 90, disabled chroma subsampling, and the enabled JPEG progressive technique.
 
```csharp
using (var reader = new JpegReader(@"Images\in.jpg"))
using (var writer = new JpegWriter(@"Images\Output\out.jpg"))
{
    writer.Quality = 90;
    writer.UseSubsampling = false;
    writer.IsProgressive = true;
    Pipeline.Run(reader + writer);
}
```
 
## Inheritance Hierarchy
  
- System.Object
    - [Aurigma.GraphicsMill.PipelineElement](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_PipelineElement.htm.md)
        - [Aurigma.GraphicsMill.Codecs.ImageWriter](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageWriter.htm.md)
            - Aurigma.GraphicsMill.Codecs.JpegWriter
 
## 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

- [JpegWriter Members](https://www.graphicsmill.com/docs/gm/AllMembers_T_Aurigma_GraphicsMill_Codecs_JpegWriter.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)

### Manual

- [Supported File Formats](https://www.graphicsmill.com/docs/gm/supported-file-formats.htm.md)
- [Working with JPEG](https://www.graphicsmill.com/docs/gm/working-with-jpeg.htm.md)
