---
title: "LosslessJpeg.Write Method (String)"
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_LosslessJpeg_Write_1_bb3a7a4f.htm
product: "Graphics Mill"
---

# LosslessJpeg.Write Method (String)
 
Writes the image to to the specified file.
 
**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 void Write(string fileName
)
```
 
### Parameters
 
 - fileName
     - Type: System.String
The name of the file to save the result.
 
## Remarks
 This method is useful for updating metadata.
 
## Examples
  
```csharp
using (var losslessJpeg = new LosslessJpeg(@"Images\in.jpg"))
{
    // IPTC
    if (losslessJpeg.Iptc == null)
        losslessJpeg.Iptc = new IptcDictionary();
    losslessJpeg.Iptc[IptcDictionary.Caption] = "Mountain";

    // EXIF
    if (losslessJpeg.Exif == null)
        losslessJpeg.Exif = new ExifDictionary();
    losslessJpeg.Exif[ExifDictionary.Software] = "Aurigma Graphics Mill";

    // XMP
    var xmp = new XmpData();
    if (losslessJpeg.Xmp != null)
        xmp.Load(losslessJpeg.Xmp);
    var node = new XmpValueNode(XmpNodeType.SimpleProperty, "John Wood", XmpTagNames.DCCreator);
    xmp.AddNode(node);
    losslessJpeg.Xmp = xmp.Save();

    // Adobe image resource blocks
    if (losslessJpeg.AdobeResources == null)
        losslessJpeg.AdobeResources = new AdobeResourceDictionary();
    var arBlock = new AdobeResourceBlock("Copyright", new byte[] { 1 });
    losslessJpeg.AdobeResources[0x040A] = arBlock;

    losslessJpeg.Write(@"Images\Output\out.jpg");
}
```
   
## See Also

### Reference

- [LosslessJpeg Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_LosslessJpeg.htm.md)
- [Write Overload](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Codecs_LosslessJpeg_Write.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
