ColorSpaceTags - Shortcut tag not found

Started by saurabheights, September 03, 2016, 05:15:46 AM

Previous topic - Next topic

saurabheights

Hi,
I am using exiftool on ubuntu. Exiftool version: 9.46

I am trying to remove all metadata(to make file light, mobile-friendly) using:- exiftool -all= --ColorSpaceTags:all <ImageName>

Problem: Not a deletable group: ColorSpaceTags

P.S. If you could give me more hint on how to compress ICC data, I will be highly obliged. On checking metadata, I have found :-

[ICC_Profile]   Red Tone Reproduction Curve     : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Green Tone Reproduction Curve   : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Blue Tone Reproduction Curve    : (Binary data 14 bytes, use -b option to extract)

Sometimes, these RGB TRCs takes around 6KB(2000 bytes each) total. Just for one curve, its representation can be done using at most 256 Bytes which can further be compressed to use only around ~30 data points on X-axis(0-255) and interpolating intermediate values. Facebook has implemented something on this line - https://www.facebook.com/notes/facebook-engineering/under-the-hood-improving-facebook-photos/10150630639853920/. Similar work is done by I suppose Adobe as well, as seen in above example.

Phil Harvey

ColorSpaceTags is not a group.  Did you mean ICC_Profile?:

exiftool -all= --iccprofile:all FILE

You know more than I do about compressing ICC Profiles.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

saurabheights

Hi Phil,
The ColorSpaceTags is from here: http://www.exiftool.org/TagNames/Shortcuts.html and groups ExifIFD:ColorSpace, ExifIFD:Gamma, InteropIFD:InteropIndex and ICC_Profile, all together.

I suppose I can extend your command to:

exiftool -all= --icc_profile:all --ExifIFD:ColorSpace --ExifIFD:Gamma --InteropIFD:InteropIndex input.jpeg -o output.jpeg

Question : The above command though gives in output:- Sorry, InteropIFD:InteropIndex is unsafe for writing. If this tag is important for Color information, then shouldn't this be allowed for writing. Also, if I remove -o output.jpeg, I am basically removing all metadata except the four tags/tags groups. However, this still gives me the error message.

On googling regarding tag InteropIFD:InteropIndex:-
The tag has been specified as unsafe here: "http://www.exiftool.org/TagNames/Shortcuts.html". However, after reading about interoperability, I couldn't make much sense. Tried, exif documentation as well as this link: http://www.awaresystems.be/imaging/tiff/tifftags/interoperabilityifd.html and http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/interoperability.html.

I really appreciate any help you can provide. Thank you.

P.S. Thank you for the comment "You know more than I do about compressing ICC Profiles". It truly made my day :). Although, I was just deep diving due to shock of seeing 6Kb of metadata, in just three metadata fields.

Phil Harvey

Quote from: saurabheights on September 03, 2016, 11:37:33 AM
The ColorSpaceTags is from here: http://www.exiftool.org/TagNames/Shortcuts.html and groups ExifIFD:ColorSpace, ExifIFD:Gamma, InteropIFD:InteropIndex and ICC_Profile, all together.

Oh, sorry.  I missed this because I was in a hurry.  So I think the command you wanted was:

exiftool -all= -tagsfromfile @ -colorspacetags FILE

You must copy tags back again using -tagsfromfile because individual tags may not be excluded from a mass delete (see the --TAG section of the application documenation).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

saurabheights

#4
Hi,
Thank you Phil. I have using following commands to remove undesired metadata :

When Source image is destination image:-
exiftool -all= -tagsfromfile @ -colorspacetags -Orientation -overwrite_original inputImagePath


When Source image is different than destination image. The destination image file should preexist.:-
exiftool -all= -tagsfromfile -colorspacetags -Orientation -overwrite_original " + inputImagePath + " -o " + outputImagePath

As corrected by Phil:
exiftool -all= -tagsfromfile inputImagePath -colorspacetags -Orientation -overwrite_original outputImagePath

This would help anyone else surfing for this problem.

There is still one minor issue. When destination image does not exists, the command reports "Can't create JPEG files from scratch". Is it possible to create the JPEG using exiftool?

Phil Harvey

Quote from: saurabheights on September 06, 2016, 09:02:07 AM
When Source image is different than destination image. The destination image file should preexist.:-
exiftool -all= -tagsfromfile -colorspacetags -Orientation -overwrite_original " + inputImagePath + " -o " + outputImagePath

There is an error in this command:  You haven't specified a file name for the -tagsFromFile option.

QuoteThere is still one minor issue. When destination image does not exists, the command reports "Can't create JPEG files from scratch". Is it possible to create the JPEG using exiftool?

A valid JPEG file needs an image.  ExifTool can not create an image from scratch.  The thing to do is start from a base JPEG file that you create somehow, then copy it and add the metadata with ExifTool.

Or you can use ExifTool to create a .EXV file, which is essentially a .JPEG without the image.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

saurabheights

Thank you. I will edit the post to show the correct command.

Highly obliged. :)