Apple - Where does the Mac store account pictures?
Mac OS X 10.5+ stores user's account pictures within the Directory Service with the exception of an account that has not modified their user picture from when first created. When first created an account contains a 'Picture' attribute in their user record that is a path to the image in question. This can be read using the dscl
command (dscl . -read /Users/${USER} Picture
).
If a user has modified their user picture at any time the account picture (aka cropped version if appropriate), it is stored in the 'JPEGPhoto' attribute of their user record.
Original files can be found at /Library/User Pictures
if you're looking for an Apple provided picture, while your personal original files should be found at ~/Library/Images/iChat Recent Pictures/
. If the files are ever removed from the iChat Recent Pictures
folder, it will not affect your user account's image whatsoever.
If you wish to extract a version of your account picture you can do so by running the following command
dscl . -read /Users/${USER} JPEGPhoto | tail -1 | xxd -r -p > ${HOME}/Desktop/accountImage.jpg
The resolution can vary, depending on the original size of the photo and what version of the operating system you're using when it is saved.
If you are running Mac OS X 10.4, my memory is failing me as I don't recall if the user picture was stored in NetInfo or not.
I was having difficulty finding the account picture cache on Mountain Lion 10.8.3. They were not found in
~/Library/Caches/com.apple.iChat/Pictures
or
~/Library/Images/iChat Recent Pictures/
Presumably this is because iChat became Messages in Mountain LionSo I used the command line tool fs_usage
to find them. By running the command
sudo fs_usage -w | grep .tiff
And then clicking and setting a new account picture you can see the path to the file that is written to disk when you change account pictures.
Turns out that in mountain lion 10.8.3 the recent account pictures have moved to:
~/Library/Containers/com.apple.ImageKit.RecentPictureService/Data/Library/Images/Recent Pictures/
I found the default pictures in /Library/User Pictures
There are six subdirectories under this directory. You can put your own set of pictures in as part of the default collection.
Create a new empty subdirectory with your name and since this is a directory outside your account and can be accessed by any user, you will have to enter your administrator password.
Then copy and paste your pictures to this new subdirectory, again entering your admin password.
Your own pictures should now show up in the default collection. Then you will have to go into the contacts app and change your photo. Then go into the Users and Groups under system preferences and change the photos. To change the photos select edit and then default and then scroll down.