Skip to main content
Stephen Marsh
Community Expert
Community Expert
August 19, 2024
Open for Voting

Add Support for IPTC/PLUS Coalition - Generative AI/ML training Metadata

  • August 19, 2024
  • 13 replies
  • 922 views

I believe that it would be a good thing to add native File Info support for the following to Adobe products via File Info and Metadata Templates:

 

https://iptc.org/news/exclude-images-from-generative-ai-iptc-photo-metadata-standard-2023-1/

 

Caveats: Not for Adobe Stock and this requires that the embedded metadata is not stripped out  :]

13 replies

Stephen Marsh
Community Expert
Community Expert
September 26, 2024

A GUI version for Photoshop:

 

 

 

 

/*
Add IPTC PLUS Generative AI-ML Metadata to Open Doc scriptUI GUI.jsx
v1.0 - 26th September 2024, Stephen Marsh
v1.1 - 27th September 2024, Added a "None" option to remove data mining metadata
https://community.adobe.com/t5/photoshop-ecosystem-ideas/add-support-for-iptc-plus-coalition-generative-ai-ml-training-metadata/idi-p/14808232

https://iptc.org/news/exclude-images-from-generative-ai-iptc-photo-metadata-standard-2023-1/
https://ns.useplus.org/LDF/ldf-XMPSpecification#DataMining

Regional laws applying to an asset may prohibit, constrain, or allow data mining for certain purposes (such as search indexing or research), and may overrule the value selected for this property. Similarly, the absence of a prohibition does not indicate that the asset owner grants permission for data mining or any other use of an asset. The prohibition “Prohibited except for search engine indexing” only permits data mining by search engines available to the public to identify the URL for an asset and its associated data (for the purpose of assisting the public in navigating to the URL for the asset), and prohibits all other uses, such as AI/ML training.
*/

#target photoshop

if (app.documents.length) {
    // Create the ScriptUI dialog
    var dialog = new Window("dialog", "Add IPTC PLUS Data Mining Permission Metadata");
    dialog.orientation = "column";
    dialog.alignChildren = ["left", "top"];
    dialog.spacing = 10;
    dialog.margins = 16;

    // Create the label and dropdown menu
    dialog.add("statictext", undefined, "Data Mining Permission:");
    var dropdown = dialog.add("dropdownlist", undefined, [
        "Unspecified - no prohibition defined",
        "Allowed",
        "Prohibited for AI/ML training",
        "Prohibited for Generative AI/ML training",
        "Prohibited except for search engine indexing",
        "Prohibited",
        "None"  // Remove data mining metadata
    ]);
    dropdown.selection = 0;

    // Array of corresponding values
    var dropdownValues = [
        "DMI-UNSPECIFIED",
        "DMI-ALLOWED",
        "DMI-PROHIBITED-AIMLTRAINING",
        "DMI-PROHIBITED-GENAIMLTRAINING",
        "DMI-PROHIBITED-EXCEPTSEARCHENGINEINDEXING",
        "DMI-PROHIBITED",
        ""  // "None"
    ];

    // Create OK and Cancel buttons
    var buttonGroup = dialog.add("group");
    buttonGroup.orientation = "row";
    buttonGroup.alignment = ["right", "top"];
    var okButton = buttonGroup.add("button", undefined, "OK");
    var cancelButton = buttonGroup.add("button", undefined, "Cancel");

    // Show the dialog
    if (dialog.show() == 1) {
        var contVocabEntry = dropdownValues[dropdown.selection.index];

        if (ExternalObject.AdobeXMPScript === undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
        var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);

        if (contVocabEntry === "") {
            xmp.deleteProperty("http://ns.useplus.org/ldf/xmp/1.0/", "DataMining");
        } else {
            xmp.setProperty("http://ns.useplus.org/ldf/xmp/1.0/", "DataMining", "https://ns.useplus.org/ldf/vocab/" + contVocabEntry);
        }

        app.activeDocument.xmpMetadata.rawData = xmp.serialize();

        alert("Data Mining Permission set to: " + "\r" + dropdown.selection.text);
    }
} else {
    alert("A document must be open to run this script!");
}

 

 

Stephen Marsh
Community Expert
Community Expert
August 19, 2024

This example Photoshop script will clear and add the AI/ML data mining "prohibited" metadata entry to an open document.

 

/*
Add IPTC PLUS Generative AI-ML Metadata to Open Doc.jsx
v1.0 - 19th August 2024, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-ideas/add-support-for-iptc-plus-coalition-generative-ai-ml-training-metadata/idi-p/14808232

https://iptc.org/news/exclude-images-from-generative-ai-iptc-photo-metadata-standard-2023-1/
https://ns.useplus.org/LDF/ldf-XMPSpecification#DataMining

Example Controlled Vocabulary Entries:

https://ns.useplus.org/ldf/vocab/DMI-UNSPECIFIED
https://ns.useplus.org/ldf/vocab/DMI-ALLOWED
https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-AIMLTRAINING
https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-GENAIMLTRAINING
https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-EXCEPTSEARCHENGINEINDEXING
https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED
*/

#target photoshop

if (app.documents.length) {
    var contVocabEntry = "https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED";
    if (ExternalObject.AdobeXMPScript === undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
    var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);
    xmp.deleteProperty("http://ns.useplus.org/ldf/xmp/1.0/", "DataMining");
    xmp.setProperty("http://ns.useplus.org/ldf/xmp/1.0/", "DataMining", contVocabEntry);
    app.activeDocument.xmpMetadata.rawData = xmp.serialize();
} else {
    alert("A document must be open to run this script!");
}

 

Here it is for selected files in Adobe Bridge:

 

/*
Add IPTC PLUS Generative AI-ML Metadata from Bridge Tools.jsx
v1.0 - 19th August 2024, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-ideas/add-support-for-iptc-plus-coalition-generative-ai-ml-training-metadata/idi-p/14808232

https://ns.useplus.org/LDF/ldf-XMPSpecification#DataMining
https://iptc.org/news/exclude-images-from-generative-ai-iptc-photo-metadata-standard-2023-1/

Example Controlled Vocabulary Entries:

https://ns.useplus.org/ldf/vocab/DMI-UNSPECIFIED
https://ns.useplus.org/ldf/vocab/DMI-ALLOWED
https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-AIMLTRAINING
https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-GENAIMLTRAINING
https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-EXCEPTSEARCHENGINEINDEXING
https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED
*/

#target bridge

addAIMLmeta = {};

addAIMLmeta.execute = function () {

    var contVocabEntry = "https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED";

    var sels = app.document.selections;
    for (var i = 0; i < sels.length; i++) {
        var md = sels[i].synchronousMetadata;
        // Clear the metadata before writing?
        md.namespace = "http://ns.useplus.org/ldf/xmp/1.0/";
        md.DataMining = contVocabEntry;
    }
}

if (BridgeTalk.appName == "bridge") {
    var menu = MenuElement.create("command", "Add PLUS Generative AI-ML Metadata", "at the end of Tools");
    menu.onSelect = addAIMLmeta.execute;
}

 

 

Stephen Marsh
Community Expert
Community Expert
August 19, 2024

Some example ExifTool (12.67) commands:

 

 

exiftool -XMP-plus:DataMining='https://ns.useplus.org/ldf/vocab/DMI-UNSPECIFIED' 'pathToFileOrFolder'

exiftool -XMP-plus:DataMining='https://ns.useplus.org/ldf/vocab/DMI-ALLOWED' 'pathToFileOrFolder'

exiftool -XMP-plus:DataMining='https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-AIMLTRAINING' 'pathToFileOrFolder'

exiftool -XMP-plus:DataMining='https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-GENAIMLTRAINING' 'pathToFileOrFolder'

exiftool -XMP-plus:DataMining='https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED-EXCEPTSEARCHENGINEINDEXING' 'pathToFileOrFolder'

exiftool -XMP-plus:DataMining='https://ns.useplus.org/ldf/vocab/DMI-PROHIBITED' 'pathToFileOrFolder'

exiftool -XMP-plus:DataMining= 'pathToFileOrFolder'

 

 

(Windows users would swap out the single-straight quotes ' for double-straight quotes ")

 

I'll need to see if it is possible to script Photoshop or Bridge to add such metadata...

 

Of course, this depends on machine learning companies to support and honour such metadata entries excluding them from training their services on your data (yeah, I know).