Bug 452680

Summary: Interpret and display the IPTC Image-Region tag (in analogy to face tags)
Product: [Applications] digikam Reporter: Paul Krause <paul_krause_1980>
Component: Metadata-IptcAssignee: Digikam Developers <digikam-bugs-null>
Status: REPORTED ---    
Severity: wishlist CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 7.6.0   
Target Milestone: ---   
Platform: unspecified   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Paul Krause 2022-04-16 15:44:00 UTC
SUMMARY
Since 2019 the IPTC standard has an Image Region tag, to define/show general subregions in an image and store additional metadata for them. Facetags can be considered a specialization of this idea.
Besides Wikimedia Commons using the same idea for so-called annotations, I personally find this tag very useful.
It would be nice if Digikam could read, display, and maybe delete these regions.
Personally I do not mind if the feature to edit, or create, regions is implemented only later.



ADDITIONAL INFORMATION
I'd guess some code from the faces implementation could be reused. This would not be completely trivial for the following reasons:
A) Image-regions allow for non-rectangular shapes, which need other code for drawing them.
B) The need to thumbnail non-rectangular shapes. I'd suggest to either skip them (by having no dedicated Image Region tab or showing the thumbnail of the full image) or, preferable, crop to an enclosing rectangle, optionally with transparency. Enclosing rectangles might need to be discussed for point and line shapes.
C) Facetags only store one additional tag, the name. Image-regions allow for more. To get started, one could just show them blindy. For writing one could allow manipulation only of selected ones, like the name, and copy all others blindly.



Of course I'm willing to further discuss this topic.
Many Thanks!
Comment 1 caulier.gilles 2022-04-16 16:53:05 UTC
Hi,

IPTC face region is not supported by Exiv2 library, the first backend used by digiKam to handle metadata.

https://exiv2.org/iptc.html

ExifTool, the second one, don't do  it to:

https://exiftool.org/TagNames/IPTC.html

Without one of this backend supporting this information, we will not able to do it in digiKam.

Also, XMP support image region, and digiKam is able to handle this information (read/write).

Gilles Caulier
Comment 2 Maik Qualmann 2022-04-16 19:08:28 UTC
IPTC Image Regions doesn't appear to be in the list of supported IPTC tags. However according to this thread Exiftool probably supports this tag. However, it is not recommended to use it as currently no software except ExifTool supports it.

https://exiftool.org/forum/index.php?topic=12499.0

Maik
Comment 3 Maik Qualmann 2022-04-16 19:21:53 UTC
Here is a sample image. Yes, ExifTool knows IPTC Regions. Since IPTC Regions is just an extension of XMP, Exiv2 can also read it.

https://www.iptc.org/std/photometadata/examples/image-region-examples/
https://www.iptc.org/std/photometadata/examples/image-region-examples/images/photo-4iptc-heads.jpg

My personal opinion is that IPTC Image Regions will not see widespread use. Of course I could be wrong...

Maik
Comment 4 Paul Krause 2022-04-19 13:22:59 UTC
Dear Maik, dear Gilles,

I do not dare to predict the usage, but, according to some googling, there is virtually no software using them at the moment.
The only "big" usage of non-face regions I'm aware of is Wikimedia Commons, for example:
https://commons.wikimedia.org/wiki/File:Helsinki-hafen-panorama.jpg
https://commons.wikimedia.org/wiki/File:Image-February_21,_2008_lunar_eclipse_and_stars,_West_Hartford,_CT,_3-17_UTC.jpg

I'd just guess, the more software, and image repositories, support non-face regions, the likelier for others to do so too.



In case there is only doubt about the specific IPTC regions, personally I would be fine with some other implementation too. But, I do not see a good alternative to appear soon.
A) The region in the MWG namespace [1] is to limited. E.g., it only allows regions (per the tag mwg-rs:Type) for "BarCode", "Face", "Focus" and "Pet". The MWG seems to be dead, so little hope for a new version.
B) Inventing new tags, or a whole namespace, and expanding, or breaking, some existing specification is similar to the Acdsee namespace in xmp, which exiftool comments with "Your applications mumble to themselves instead of speaking out for the rest of the world to hear." [2].



[1] https://web.archive.org/web/20180919181934/http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf#page=51
[2] https://exiftool.org/TagNames/XMP.html#acdsee


Thanks, Paul
Comment 5 Paul Krause 2022-04-19 15:05:34 UTC
I forgot:
The tag mwg-rs:Type for MWG regions is optional and specifically not to be set for anything outside the closed choice (Face, Barcode, ...).
Duplicating the faces tab, but stripping the face detection etc, together with the display in the preview area and handling all MWG regions with type != "Face" with this new code, sounds like the second best option for me.
Comment 6 Maik Qualmann 2022-04-19 16:39:52 UTC
Just for info, I know you just want to demonstrate what IPTC image regions are used for. But the two images from Wikimedia are not IPTC image regions, the metadata of the images do not contain regions. So it's probably just a matter of HTML regions.

Maik
Comment 7 Paul Krause 2022-04-19 18:25:42 UTC
I do not know if I understand you correctly, or if my answer matters, but:

You are absolutely right, these regions on Wikimedia Commons are not IPTC Image regions.
I was aware of that, but possibly I'm not writing clear enough.
What I wanted to show is, that regions (not necessary IPTC or MWG ones) are used for something else then faces.
Possibly Wikimedia Commons ("Annotations") and Flickr ("Photo notes") are the only ones, but still somebody is using non-face regions.

It probably would have been smarter to not ask for IPTC Image regions from the very beginning. They just seem to be the best choice to me.

Paul