Spotlight is the system that classifies files, so if you use the command line tool in terminal.app to list the spotlight information of a file you can see how the classification is performed:
- Open terminal
mdls and then drag any file from your desktop (or anywhere in finder) to the window and drop the icon.
- Press return
The fields to focus on are kMDItemContentType and kMDItemContentTypeTree and a bit further down the list is kMDItemKind ;
kMDItemContentType = "public.png"
kMDItemContentTypeTree = (
kMDItemKind = "Portable Network Graphics image"
In my example I used a screen shot png file - which is one of many image formats that will then be counted against the total. Under kind information, you can also see the logical (size of the bits) and physical size (how much space the file takes up on the drive with overhead for block sizes and accounting) which would get summed up for each "category"
So - to find out what might be categorized as an image - type this command out (or paste it if you trust me/it/whomever edits this last):
mdfind "kMDItemKind = '*image*'" | head -3
The pipe symbol
| takes all the lines of text that
mdfind produces and shows you the first three lines of text. Instead of piping to
head -3 you could also pipe to
more to page through the list one screen at a time. Press spacebar to move, q to quit and h for help in more.
To count all the files with the string image in the kMDItemKind field:
mdfind "kMDItemKind = '*image*'" | wc -l
For context, my two smaller Mac have between 85k image files and 110k image files. Note, on newer OS - some of the images will be marked "purgeable" so you might over count at the command line but you should have a better feeling of what images exist and if you need to uninstall apps or they are just part of the operating system to have images to show you for the controls in Safari, the default desktop backgrounds, etc...