What to rename the exiftool(-k)

Started by boelens218, May 29, 2025, 10:30:45 PM

Previous topic - Next topic

boelens218

Hello,

I downloaded the exiftool 13.30x64 and found the exiftool(-k) file. I renamed it to exiftool(-overwrite_original -all=) and was able to successfully remove all the metadata from my jpeg files by dragging them to the renamed file.

However, this removed the color profile also which could be a problem. I understand this is because software will have to guess which color profile the image is. For example, the color profile for some of my jpegs were sRGB IEC61966-2.1 but now they show up as Untagged RGB.

I also have some jpegs with the DCI-P3 D65 Gamut with sRGB Transfer color profile which now also show up as Untagged RBG.

It looks like there is a way to strip all the metadata except for the color profile when installing exiftool and using the command prompt. However, I'm only interested in using exiftool by dragging files over to the exiftool(-k) file. Is there a way to do this by renaming the file to something? For example, I found the command exiftool( -overwrite_original --icc_profile:all) when doing some research, but a : can't be used when renaming a file.

Thanks,

StarGeek

Yes, the colon is a reserved character and can't be uses as part of a filename.

Try this. It will still give a warning about removing the ICC_Profile, but the -TagsFromFile option copies the profile back into the file.
exiftool(-overwrite_original -all= -TagsFromFile @ -ICC_Profile)

Any command requiring reserved characters would need to be made into a Windows BAT file. Something like this. The %* will be replaced by the names of the files dropped onto the BAT file icon
exiftool -overwrite_original -all= -TagsFromFile @ -ICC_Profile %*
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

boelens218

I renamed the file as you suggested, and it worked! All the metadata was removed except for color space information. Now, when I open the image in photoshop, it says sRGB IEC61966-2.1 instead of Untagged RGB. To be clear, I renamed the file exactly like below.

exiftool(-overwrite_original -all= -TagsFromFile @ -ICC_Profile)

When I strip ALL the metadata using exiftool(-overwrite_original -all=), the color space for the photo doesn't change, it's just becomes unidentified, correct? Therefore, does it really make a difference either way? Bottomline, is it always better for an image file to have to the color space information?

I didn't understand your last part of your message about %* and BAT files. To be clear, are you recommending that I rename the file exactly like below for another purpose?

exiftool -overwrite_original -all= -TagsFromFile @ -ICC_Profile %*

Phil Harvey

The syntax to exclude the ICC_Profile tags from deletion instead of copying them back again aftwards would be more efficient:

exiftool -overwrite_original -all= --icc_profile:all FILE

But I assume that StarGeek didn't mention this as an alternative for renaming exiftool(-k).exe because the colon is not a legal character in a Windows file name.

However, in a BAT file this would be the way to do it.  For a BAT file, you would rename the executable to "exiftool.exe" and make a separate "some_name.BAT" file containing this line:

c:\path\to\exiftool.exe -overwrite_original -all= --icc_profile:all %*

- 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 ($).

StarGeek

I remembered that you might also want to add -ColorSpaceTags tags to the command
exiftool(-overwrite_original -all= -TagsFromFile @ -ColorSpaceTags)

ColorSpaceTags is a shortcut tag that contains several other tags that can affect colors in an image. ICC_Profile is included in ColorSpaceTags, so copying that individually can be dropped. See the Shortcuts tags page to see what tags are included in ColorSpaceTags.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

boelens218

I am really confused with the two previous messages. I don't know what a BAT file is and don't think it's relevant to me. As the title says, I am only looking to rename the exiftool(-K) file. Therefore, if I'm looking to remove all the metadata from JPEG/TIFF files except for the color space profiles, do I rename the file exactly as below? Please answer yes or no. 

exiftool(-overwrite_original -all= -TagsFromFile @ -ICC_Profile)

When I strip ALL the metadata by renaming exiftool(-k) to exiftool(-overwrite_original -all=), the color space for the photo doesn't actually change, it's just becomes unidentified, correct? Therefore, does it really make a difference either way? Bottomline, is it always better for an image file to have to the color space profile information?

Thank you,

Phil Harvey

Yes. Best to keep color space tags. So if renaming the exe, use StarGeek's last suggestion.

- 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 ($).

StarGeek

Quote from: boelens218 on May 30, 2025, 03:47:49 PMI don't know what a BAT file is and don't think it's relevant to me.

A Windows batch file is just a text file with a list of commands to execute in order. If the command you want to use includes a character that you can't put in a file name, like a colon, then you would have to create the command and save it as a batch file. It would then have the same drag/drop ability but allow the use of restricted characters.

QuoteTherefore, if I'm looking to remove all the metadata from JPEG/TIFF files except for the color space profiles, do I rename the file exactly as below? Please answer yes or no. 

exiftool(-overwrite_original -all= -TagsFromFile @ -ICC_Profile)

Yes, though as I posted, I think this would be the better choice, as it copies more color information
exiftool(-overwrite_original -all= -TagsFromFile @ -ColorSpaceTags)

QuoteWhen I strip ALL the metadata by renaming exiftool(-k) to exiftool(-overwrite_original -all=), the color space for the photo doesn't actually change, it's just becomes unidentified, correct? Therefore, does it really make a difference either way? Bottomline, is it always better for an image file to have to the color space profile information?

Depending upon the device dealing with the image, the colors might change. It depends upon how aware the program is of the color information in the file.

Example #1 - Removing the Adobe APP14 block (which exiftool will not do unless specifically commanded to do so) can drastically alter the colors.

Example #2 - Removing the ICC_Profile can alter the image in more subtle ways. In that example, the original image was set to be more brown/less blue because of the ICC_Profile. Removing the ICC_Profile made the blue more prominate.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

boelens218

Thanks for all the clarification. Since I am able to rename the exe for my purpose, I don't need to worry about a BAT file, correct?

I will use your last suggestion exactly like below then. As you pointed out, this will retain all the color space information and not just the ICC_Profile. I see there are a total of 4 color space tags.
exiftool(-overwrite_original -all= -TagsFromFile @ -ColorSpaceTags)

Thanks for letting me know it's always best to retain the color space tags for image files. With that being said, I assume you would never want to remame the exe like below for image files.
exiftool(-overwrite_original -all=)

I see that the exiftool works differently with jpegs and tiffs. For example, with jpegs it removes ALL the possible metadata but some still remains with tiff files. Also, the dpi changes from 72 to 96 with the jpeg files. Is all this normal? Please see screen shot below, the tiff file is on the left.

Last, is there a maximum amount of files I can drag over to the exe at once? For example, I was planning on dragging 250 files over at once. I won't drag over a mix jpegs and tiffs together, I will keep them separate.

Awesome tool and thanks again!
 

StarGeek

Quote from: boelens218 on May 30, 2025, 07:58:55 PMI see that the exiftool works differently with jpegs and tiffs. For example, with jpegs it removes ALL the possible metadata but some still remains with tiff files.

Due to the way TIFF files are set up, you can't remove everything otherwise you could easilly make it so the TIFF image is unrenderable.

See FAQ #7, I can't delete all EXIF information from a TIFF file using 'exiftool -exif:all= img.tif'

QuoteAlso, the dpi changes from 72 to 96 with the jpeg files. Is all this normal? Please see screen shot below, the tiff file is on the left.

Yes. DPI is a tag, just like any other. When you remove it, then whatever program you are using displays a default value. It doesn't affect the image in any way. It only changes the initial size when you include the image in some document. And you can always resize it once it is in the document.

QuoteLast, is there a maximum amount of files I can drag over to the exe at once? For example, I was planning on dragging 250 files over at once.

There is probably some limit defined by Windows. You can always drag a directory instead of individual files and exiftool will process all the files in the directory, but not subdirectories unless you add the -r (-recurse) option.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

boelens218