<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImageIO",
  "identifier" : "/documentation/ImageIO/CGMutableImageMetadata",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Image I/O"
    ],
    "preciseIdentifier" : "c:@T@CGMutableImageMetadataRef"
  },
  "title" : "CGMutableImageMetadata"
}
-->

# CGMutableImageMetadata

An opaque type for adding or modifying image metadata.

```
class CGMutableImageMetadata
```

## Discussion

Create a [`CGMutableImageMetadata`](/documentation/ImageIO/CGMutableImageMetadata) opaque type when you want to modify the metadata in an image. You may pass this type to any functions that take a [`CGImageMetadata`](/documentation/ImageIO/CGImageMetadata) type as a parameter. This object stores the tag information as XMP data, which you can write back to the image.

When you access or modify EXIF or IPTC properties, the metadata functions automatically bridge those properties to appropriate XMP properties. This bridging behavior fills in any fields that are present only in the XMP data. For example, it fills in the namespace, prefix, and XMP type information in the corresponding [`CGImageMetadataTag`](/documentation/ImageIO/CGImageMetadataTag) object.

## Topics

### Creating a Mutable Metadata Type

[`CGImageMetadataCreateMutable()`](/documentation/ImageIO/CGImageMetadataCreateMutable())

Creates an empty, mutable image metdata opaque type.

[`CGImageMetadataCreateMutableCopy(_:)`](/documentation/ImageIO/CGImageMetadataCreateMutableCopy(_:))

Creates a deep, mutable copy of the specified metadata information.

### Setting the Values of Tags

[`CGImageMetadataSetValueWithPath(_:_:_:_:)`](/documentation/ImageIO/CGImageMetadataSetValueWithPath(_:_:_:_:))

Update the value of an existing metadata tag, or create a new tag using the specified information.

[`CGImageMetadataSetValueMatchingImageProperty(_:_:_:_:)`](/documentation/ImageIO/CGImageMetadataSetValueMatchingImageProperty(_:_:_:_:))

Updates the value of the metadata tag assigned to the specified image property.

[`CGImageMetadataSetTagWithPath(_:_:_:_:)`](/documentation/ImageIO/CGImageMetadataSetTagWithPath(_:_:_:_:))

Sets the tag at the specified path in the metadata object.

[`CGImageMetadataRemoveTagWithPath(_:_:_:)`](/documentation/ImageIO/CGImageMetadataRemoveTagWithPath(_:_:_:))

Removes the tag at the specified path from the metadata object.

### Registering a Custom Namespace

[`CGImageMetadataRegisterNamespaceForPrefix(_:_:_:_:)`](/documentation/ImageIO/CGImageMetadataRegisterNamespaceForPrefix(_:_:_:_:))

Registers the specified namespace and prefix with the metadata object.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)