What are the top 'user created' metadata tags?

Started by Jabber, August 08, 2024, 07:48:29 AM

Previous topic - Next topic

Jabber

I'm working on a script I posted previously to automatically generate tags via a local AI model. I am currently given the option to write to: IPTC:Caption, IPTC:Keywords, XMP-dc:Title, XMP-dc:Subject, XMP-dc:Description. I know these aren't optimal but I really am kind of clueless when it comes to image metadata. What would be the most useful tags to generate to save people work organizing and tagging their photos?

For reference this is how it works:

  • It uses exiftool to extract:
                "FileName", "Directory", "FileType", "MIMEType",
                "ImageWidth", "ImageHeight", "DateTimeOriginal",
                "CreateDate", "ModifyDate", "Description", "Title",
                "Subject", "Keywords", "GPSPosition", "Make", "Model",
                "LensModel", "Artist", "Copyright", "JPGFromRawStart"
           
  • The reason it grabs JPGFromRawStart is to see if there is an embedded jpg it can use
  • The image is sent to visual capable language model which is asked to describe it
  • The description given is then sent back to the model (which has a brand new blank 'memory') along with the extracted metadata and it is asked to create certain tags

So I can ask it for anything but it has to be a result of viewing the image or existing image metadata, if that makes sense, and the more data it is given the better the results will be.

Thanks for your help.

greybeard

Would PreviewImage be the best way to get a JPG from raw files? (Or ThumbnailImage if your image processor only needs a very low res image)

Jabber

Quote from: greybeard on August 08, 2024, 09:33:40 AMWould PreviewImage be the best way to get a JPG from raw files? (Or ThumbnailImage if your image processor only needs a very low res image)

Thumbnail is too small a lot of times. It is all local so sending a 10MB file to the LLM vs a 1KB file is trivial compared to the 6GB that has to pass through memory for every generated token  ;D

StarGeek

You might look at the BigImage tag in the example.config file. It looks through all the embedded images and returns the biggest one.

The IPTC tags (IPTC:Caption-Abstract, IPTC:Keywords) are part of the older IPTC IIM standard, which has limitations and is less flexible. By the spec, these have are limited in how long of a value can be written and exiftool will truncate them unless the -m (-ignoreMinorErrors) option is used. These two tags are probably ok in regard to the limits (2,000 characters for Caption-Abstract, and 64 characters for each individual Keyword) but I've run into this problem with other tags such as the city and location.

XMP-dc:Title is probably not what you think it is. It is not a "Title" of the picture. From the IPTC Photo Metadata Standard
QuoteDefinition: A shorthand reference for the digital image. Title provides a short human readable name which can be a text and/or numeric reference. It is not the same as Headline.

Help Text: Enter a short verbal and human readable name for the image, this may be the file name

User Note(s): Many use the Title field to store the filename of the image, though the field may be used in many ways. Formal identifiers are provided by the Digital Image Id, or the Registry Entry property of the IPTC Extension.

The tag to use for a title or short description is the XMP:Headline tag, which is
QuoteA brief synopsis of the caption. Headline is not the same as Title.

But we can thank Adobe for messing this up, as for years they used Title as the location for a short description in their programs.

Headline is the name of the tag used in both IPTC and XMP. By default, exiftool would write IPTC:Headline, so you have to explicitly write XMP:Headline to use it.

But otherwise, Subject (for keywords) and Description are good tags to use. I would need to know more about the information that is returned in order to suggest any other tags.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Jabber

Quote from: StarGeek on August 08, 2024, 10:17:49 AMYou might look at the BigImage tag in the example.config file. It looks through all the embedded images and returns the biggest one.

The IPTC tags (IPTC:Caption-Abstract, IPTC:Keywords) are part of the older IPTC IIM standard, which has limitations and is less flexible. By the spec, these have are limited in how long of a value can be written and exiftool will truncate them unless the -m (-ignoreMinorErrors) option is used. These two tags are probably ok in regard to the limits (2,000 characters for Caption-Abstract, and 64 characters for each individual Keyword) but I've run into this problem with other tags such as the city and location.

XMP-dc:Title is probably not what you think it is. It is not a "Title" of the picture. From the IPTC Photo Metadata Standard
QuoteDefinition: A shorthand reference for the digital image. Title provides a short human readable name which can be a text and/or numeric reference. It is not the same as Headline.

Help Text: Enter a short verbal and human readable name for the image, this may be the file name

User Note(s): Many use the Title field to store the filename of the image, though the field may be used in many ways. Formal identifiers are provided by the Digital Image Id, or the Registry Entry property of the IPTC Extension.

The tag to use for a title or short description is the XMP:Headline tag, which is
QuoteA brief synopsis of the caption. Headline is not the same as Title.

But we can thank Adobe for messing this up, as for years they used Title as the location for a short description in their programs.

Headline is the name of the tag used in both IPTC and XMP. By default, exiftool would write IPTC:Headline, so you have to explicitly write XMP:Headline to use it.

But otherwise, Subject (for keywords) and Description are good tags to use. I would need to know more about the information that is returned in order to suggest any other tags.

Here are images and the created metadata. The 'caption' is what is generated first to create the other data fields, but it can be kept if desired. For subject at this point I asking the model for keywords and putting them in the XMP-dc:Subject field as suggested by the MWG.



Subject                        : Roadscape, Vehicle Perspective, Black Car, License Plate, NYS 1234, Roof, Rims, Spoiler, Background Vehicles
Title                          : Black Car on Moving Road from Vehicle's Perspective
Description                    : A captivating image from a vehicle's point of view, featuring a black car with a distinct license plate 'NYS 1234', moving towards the right side of the frame. The car is equipped with black rims, a black roof, and a red stripe along the trunk. Other vehicles are visible in the background, including a white car on the left and a black car on the right, as well as a black truck in the distance.
Caption: The image captures a scene from a vehicle's perspective on a road. The main focus is a black car, which is positioned in the center of the frame. The car is moving towards the right side of the image. The car is equipped with a black roof, black rims, and a black spoiler. The license plate of the car is clearly visible and reads "NYS 1234". The car is also adorned with a red stripe running along the bottom of its trunk. In the background, there are other vehicles on the road. A white car is visible on the left side of the image, and a black car is visible on the right side. Additionally, there is a black truck in the distance.



Subject                        : Man and dog, Snowy road, Winter landscape, Black attire, Red leash, Beard, Tattoo, Red bandana, Isolated scene
Title                          : Snowy Encounter: Man and His Dog on a Winter Road
Description                    : A captivating image featuring a man and his dog against a snowy backdrop. The man, dressed in black attire, holds a red leash for his brown and white dog, while standing on a road lined with trees. The scene is isolated and focuses solely on the duo, showcasing their bond amidst the winter landscape.
Caption: In the image, a man and his dog are the main subjects. The man is standing on a snowy road, dressed in a black jacket, a black beanie, and a black beanie. He is also wearing a black shirt, a red plaid flannel shirt, and black pants. He has a beard and is holding a red leash in his right hand. The leash is attached to a brown and white dog, which is sitting on the ground. The man has a tattoo on his left arm and a red bandana around his neck. The background of the image consists of a snowy road and trees. The man and the dog appear to be the only subjects in the image, with no other people or objects visible.



Subject                        : Milan Cathedral, Piazza del Duomo, Gothic Architecture, Duomo di Milano, Italy, Panoramic View, Cathedral
Title                          : Milan Cathedral from Piazza del Duomo, Italy
Description                    : A panoramic view of the Piazza del Duomo in Milan, Italy, featuring the majestic Gothic Milan Cathedral as the central focus. The cathedral showcases its intricate details, white color, and iconic architecture elements, while the bustling piazza is filled with people.
Caption: The image captures a panoramic view of the Piazza del Duomo in Milan, Italy, with the majestic Gothic Milan Cathedral, also known as the Milan Cathedral or the Duomo di Milano, as the central focus. The cathedral, a large, ornate, and intricate structure, is predominantly white, with numerous spires and intricate details. It is a testament to Gothic architecture, with its pointed arches, ribbed vaults, and flying buttresses. The cathedral is situated on the southern side of the piazza, with its back facing the viewer. The piazza itself is bustling with activity. People are seen walking around, some carrying umbrellas, suggesting a possibility of rain.



Subject                       : Senior Man, White Hair, Blue Suit, Black Neck Wrap, Positive Mood, Gray Background, Portrait
Title                          : Senior Gentleman in Blue Suit and Black Neck Wrap
Description                    : An image featuring a man in his 60s or 70s with white hair, dressed in a blue suit and black neck wrap, smiling positively. The background is plain gray, emphasizing the man's appearance and expression.
Caption: In the image, we see a man who appears to be in his 60s or 70s. He has white hair and is wearing a black neck wrap. His face is visible, and he is smiling, suggesting a positive mood. The man is dressed in a blue suit, which contrasts with the black neck wrap. The background is a plain gray color, drawing attention to the man in the foreground. The image does not contain any text or additional elements that would provide further context or information about the man or the setting. The focus is solely on the man's appearance and expression.

StarGeek

One thing to watch for is that the IPTC tag is IPTC:Caption-Abstract, not "Caption". The Caption tag refers to an ACDSee program specific tag and should be avoided unless you are using ACDSee.

The question becomes which data do you want to keep and where to put it. Since it's your data, it's absolutely fine if you want to put the "Title" result in the Title tag.

What you don't want to do is put one value in IPTC:Caption-Abstract and another in XMP:Description. That will cause programs such as LightRoom to discard one or the other.

I would suggest either using "Title" in the IPTC:Headline/XMP:Headline tags and "Description" in IPTC:Caption-Abstract/XMP:Description if you feel the "Caption" is too long and wordy, or use "Description" in the IPTC:Headline/XMP:Headline tags and "Caption" in IPTC:Caption-Abstract/XMP:Description.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Jabber

Quote from: StarGeek on August 08, 2024, 12:41:24 PMOne thing to watch for is that the IPTC tag is IPTC:Caption-Abstract, not "Caption". The Caption tag refers to an ACDSee program specific tag and should be avoided unless you are using ACDSee.

The question becomes which data do you want to keep and where to put it. Since it's your data, it's absolutely fine if you want to put the "Title" result in the Title tag.

What you don't want to do is put one value in IPTC:Caption-Abstract and another in XMP:Description. That will cause programs such as LightRoom to discard one or the other.

I would suggest either using "Title" in the IPTC:Headline/XMP:Headline tags and "Description" in IPTC:Caption-Abstract/XMP:Description if you feel the "Caption" is too long and wordy, or use "Description" in the IPTC:Headline/XMP:Headline tags and "Caption" in IPTC:Caption-Abstract/XMP:Description.

So, forget Title and stick to keywords (XMP-dc:Subject) and description (XMP:Headline) and caption (XMP:Description)? Would it be OK to only write to XMP fields or should I also do the IPTC? I tried to read through and understand the MWG paper on interoperability, but it confuses me. Can I assume that exiftool handles all of that stuff?

StarGeek


Quote from: Jabber on August 08, 2024, 01:24:04 PMSo, forget Title and stick to keywords (XMP-dc:Subject) and description (XMP:Headline) and caption (XMP:Description)?

That sounds good.

QuoteWould it be OK to only write to XMP fields or should I also do the IPTC? I tried to read through and understand the MWG paper on interoperability, but it confuses me. Can I assume that exiftool handles all of that stuff?

This depends on other programs in the workflow and who the end user is. If other people are going to use it, then you might want to include the IPTC tags or at least the option to do so. Most modern programs will read the XMP tags, but there are still older programs in use that cannot read them, only the IPTC IIM ones.

The MWG tags are nice because they can write both IPTC and XMP at the same time. They will also only write IPTC tags if there is existing IPTC data. But while MWG:Keywords and MWG:Description cover two of your tags, there isn't a matching entry for Headline.

I usually promote XMP only if possible, as doing the bookkeeping to keep IPTC and XMP in sync is a pain. But in the long run, this has to be a user choice.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Jabber

Quote from: StarGeek on August 08, 2024, 02:41:59 PM
Quote from: Jabber on August 08, 2024, 01:24:04 PMSo, forget Title and stick to keywords (XMP-dc:Subject) and description (XMP:Headline) and caption (XMP:Description)?

That sounds good.

QuoteWould it be OK to only write to XMP fields or should I also do the IPTC? I tried to read through and understand the MWG paper on interoperability, but it confuses me. Can I assume that exiftool handles all of that stuff?

This depends on other programs in the workflow and who the end user is. If other people are going to use it, then you might want to include the IPTC tags or at least the option to do so. Most modern programs will read the XMP tags, but there are still older programs in use that cannot read them, only the IPTC IIM ones.

The MWG tags are nice because they can write both IPTC and XMP at the same time. They will also only write IPTC tags if there is existing IPTC data. But while MWG:Keywords and MWG:Description cover two of your tags, there isn't a matching entry for Headline.

I usually promote XMP only if possible, as doing the bookkeeping to keep IPTC and XMP in sync is a pain. But in the long run, this has to be a user choice.

Thanks so much for your help. I think I am just going to do simple and only include MWG:Keywords and MWG:Description. Anything else can be derived from them and I don't think it there is a benefit to filling up a bunch of spaces just because I can. If it seems too complicated, it probably is -- for me at least -- I should strive to reach the limits of my own competence and not go one step beyond...