# eSign Image with Metadata signature This article shows how to add metadata signatures to the image exif metadata layer with various data types ## Overview Metadata signature for Image document is an electronic signature based on image metadata standard. Most image formats support metadata specification or [EXIF](https://en.wikipedia.org/wiki/Exif). Image metadata is dictionary map with unique whole short identifier in range 0-65535, Some identifiers are reserved by [EXIF specification.](https://www.exiv2.org/tags.html) From signature perspective image metadata may content any hidden value of standard (int,char, string) or custom type (user defined class), be encrypted and decrypted back by known key over Search method. [**GroupDocs.Signature**](https://products.groupdocs.com/signature/python-net) provides [ImageMetadataSignature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/imagemetadatasignature) class to specify Metadata e-signature for image documents. Image document metadata contains pair with unique identifier Id and its Value. Image document metadata could keep big amount of data that provides ability to keep serialized custom objects with additional encryption in there. ### Here are the steps to add metadata signatures into Image with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class and pass source document path as a constructor parameter. * Instantiate the [MetadataSignOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/metadatasignoptions) object according to your requirements. * Instantiate one or several [ImageMetadataSignature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/imagemetadatasignature) objects and add them to the options with the [add](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/metadatasignoptions/add) method, or to its [signatures](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/metadatasignoptions/signatures) collection with the [append](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/metadatasignaturecollection/append) or [add_range](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/metadatasignaturecollection/add_range) method. * Call [Sign](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/sign/) method of [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class instance and pass [MetadataSignOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/metadatasignoptions) to it. ## How to eSign Image with Metadata signature This example shows how to sign png image with metadata e-signatures {{< tabs "sign_png" >}} {{< tab "Python" >}} ```python from datetime import datetime from groupdocs.signature import Signature from groupdocs.signature.options import MetadataSignOptions from groupdocs.signature.domain import ImageMetadataSignature def sign_png(): with Signature("sample.png") as signature: options = MetadataSignOptions() # Image metadata entries are identified by a number, not a name metadata_id = 41996 # Add several Image Metadata signatures with values of different types options.add(ImageMetadataSignature(metadata_id, "Mr.Scherlock Holmes")) # text options.add(ImageMetadataSignature(metadata_id + 1, datetime.now())) # date and time options.add(ImageMetadataSignature(metadata_id + 2, 123456)) # whole number options.add(ImageMetadataSignature(metadata_id + 3, 123.456)) # floating-point number # Sign the image and save the result result = signature.sign("signed.png", options) print(f"Signed with {len(result.succeeded)} metadata signature(s):") for item in result.succeeded: print(f" {item.id}") if __name__ == "__main__": sign_png() ``` {{< /tab >}} {{< tab "sample.png" >}} {{< tab-text >}} `sample.png` is the sample file used in this example. Click [here](https://docs.groupdocs.com/signature/python-net/_sample_files/developer-guide/basic-usage/electronic-signature-types/esign-document-with-metadata-signature/esign-image-with-metadata-signature/sample.png) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "signed.png" >}} ```text Binary file (PNG, 77 KB) ``` [Download full output](https://docs.groupdocs.com/signature/python-net/_output_files/developer-guide/basic-usage/electronic-signature-types/esign-document-with-metadata-signature/esign-image-with-metadata-signature/sign_png/signed.png) {{< /tab >}} {{< /tabs >}} ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for Python via .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET) ### Free Online Apps Along with the full-featured Python library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**.