I took a picture to add to my account on Mac.
Now I want to use it on messenger, but I can't find it. On the account config, it's too small. I need to find the original.
Where are the accout pictures stored on a Mac?
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.
dscl . -read /Users/short_username JPEGPhoto | tail -1 | xxd -r -p > /PATH/TO/accountImage.jpg
-- works as advertised, just that you get a 256x256 px version of your account picture. :)
Commented
Jun 29, 2012 at 14:00
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/
~/Library/Containers/com.apple.ImageKit.RecentPictureService/Data/Library/Images/Recent Pictures/
worked for Mavericks
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.
On Mac OS X 10.8.2 Mountain Lion, they exist as files that are a mix of jpegs and tiffs on my Mac. Thus, they can be copied to another location.
The full set of user photos are in two different locations. However, the user photo in question, does not necessarily correlate with the respective user folder. So it's a bit quirky.
Look at: Macintosh HD/Users/user0/Library/Images/iChat Recent Pictures/ By 'user0' I refer to the name of the first-defined user on the system (see below context). In this location are 3 user photos, for 3 of my 4 users. 3 jpegs, all good quality. Intriguingly, it is for all users except for user0. The jpegs are called the exact names as follows: 'Recent 1.jpg', 'Recent 2.jpg' and 'Recent 3.jpg'
For user0, this photo is in: Macintosh HD/Library/Caches/ It is a tiff, poor quality. The tiff is called exactly 'com.apple.user501picturecache.tiff'
Importantly, here is the system context to above: - An Apple iMac 20" early 2009 which originally ran Mac OS X 10.5 Leopard - The first-defined user was user0. Nor the name, nor the photo, have been changed. - All other users followed shortly after. Again, nor the names nor, nor the photos, have been changed. - It has been updated with every new Mac OS X when released. - Currently running Mac OS X 10.8.2 Mountain Lion.
Note: When I updated to Lion I recall that the user0 photo did not look so good at login. It looked poorer quality. So something happened there. I expect that Lion rearranged where the photos were and did something to the photos - I have no proof of this, it's just a hunch.
That's the way to find it on OS X 10.8.3:
~/Library/Containers/com.apple.ImageKit.RecentPictureService/Data/Library/Images/Recent Pictures/
Building upon all the previous answers here is mine:
dscl . -read ~$USER JPEGPhoto | xxd -p -r > $USER.jpg
Also here is something mostly original I have found:
sudo plutil -convert xml1 -o - /var/db/dslocal/nodes/Default/users/$USER.plist |
vim '+/>j/+3,/>j//<\/d/-1j | .!base64 -D > $USER.jpg' '+q!' -
Even if it is way more complicated it can be useful, because plutil
is also available on other platforms. It converts the binary plist with the user info to xml, then uses vim to select the part with the picture and finally decodes it from base64 into jpg.
/var/db/dslocal/nodes/Default/users/[username].plist
, which can only be accessed when you're in superuser mode (using sudo
), is a plist with a key jpegphoto
whose value is the base64-encoded profile picture. Why was this answer on -1 when I found it? Re-upvoting!
Commented
Jan 17, 2022 at 9:59
Running Snow Leopard 10.6.8
I have found my captured picture for user login at the following location. Both the original and the cropped were found in ~/Library/Caches/com.apple.iChat/Pictures
If you click on the icon in the "Accounts" preference page a context menu appears that offers "Edit picture ..." as the top-most option. This opens a dialog that - at least in my case - shows a larger version of my user icon. I guess for the specific purpose of creating a messenger icon it would be feasible to simply screen-shot this picture.
Admittedly, without having the technical background to answer the actual question I'm really not sure whether the actual user icons are stored in a regular file. If this file were located inside your user account (i.e. ˜/Library) the preference page would have to crawl deeply in your account for displaying the icon if another user merely opens the "Account" preference page.
If, OTOH, the file were be stored somewhere in /Library it would probably be difficult to set the icon individually for each user who doesn't have administrator rights. Someone else shed some light on this, please.
dscl
- .plist files stored at /var/db/dslocal
)