Getting your Account icon / photo / picture in OS X

me

The iMac I have at work has an iSight, which is a decent camera. The picture I had taken for my OS X account was better than previous pictures I had. So, I wanted to get that picture and use it for my Plaxo personal card. Well, after searching in a few places, I couldn’t find it. After a bit of digging, I finally found it. If you need this, then this post is for you.

So, when you setup your account on OS X, you have the option of taking a photo. This photo is then stored with your account. You can see the picture in the System Preferences when you look at your account. Of course, you can also change it again… right there. If an app can use your picture, (like iChat, Address Book, or Mail), it can just use that one. The mystery, though, is where that picture gets stored.

Well, since it is associated with your account, it gets stored in a central location on the machine. (i.e. Not your home directory). I guess this simplifies the retrieval of these photos when the various systems need those photos (login window or the user switcher). So, I took a look in the netinfo store for my user account (ah, just like ye ole NextSTEP)… and lo, there is the path to the photo. Apparently, it stores the stuff in /Library/Caches/.

The exact name depends on your user id or uid. To get this number, just run id in a terminal. For example, my uid is 502. So, for my user id, it would use the name /Library/Caches/com.apple.user502pictureCache.tiff for my photo.

Awesome, done. All I had to do was open the file and then save it as a JPEG via Preview.

This entry was posted in General. Bookmark the permalink.

28 Responses to Getting your Account icon / photo / picture in OS X

  1. Phil Smith says:

    Thanks for the post! Just thought I would let you know that you did help out at least one other lost soul on the internet with the EXACT same issue!

    -PJ

  2. Salvatore Saieva says:

    Thanks, found the pic. Very helpful.

    Regards,

    Sal.

  3. Thanks, that helps! As a newbie developer to Mac, tips like this helps a ton.

  4. THANK YOU! this was a godsend!

  5. aadis says:

    Yup, helped me out too! mucho gracias!

  6. Michael Todd says:

    Thanks!

  7. LenaMaria says:

    Thank you! Too bad it was an itty-bitty picture. 🙂

  8. teo says:

    Hi! Perhaps it could be interesting for someone, I found my login photo under the folder com.apple.iChat/Pictures under my personal Library…

  9. Chris Tan says:

    I have the same issue and almost gave up until I stumble upon your post. Thanks

  10. anon says:

    Thanks! Still works to find login photo in OSX 10.5.5

  11. Pingback: Josh Mather » links for 2009-02-07

  12. yn says:

    Thank you!

  13. Joel says:

    Thank U ! Worked fine for me.

  14. Christian says:

    thanks mate!

  15. toothrot says:

    hooray!

  16. Luis says:

    thanks, but let me know the size of that pic is not the original..? I found one in a Chat/Pictures under my personal account number, but is a small one..! do u know how i can get the original size version of that pic..? I follow and i was looking for : Library/Caches/com.apple.user502pictureCache.tiff

    but i not found any com.apple.user or any tiff file I’m in OS X 10.5.8 maybe is in another route or i can’t found this original size because that not been stored… could someone can confirm me that or show me how i can get the original size.

    Thanks…

  17. Sorry, this answer did not work for me. There is no com.apple.user*pictureCache.tiff on my machine.

  18. Wayne says:

    Thank you! It’s still there on 10.6.2. =)

  19. Andrew says:

    You helped me too! Thank you!

  20. TC says:

    Thanks.

    [MacHD on which resides my system] /Libary/Caches .. and bingo.

    tc

  21. Hassan says:

    thank you so much.it was very helpful.

  22. Marcin says:

    Here is another way to get at your picture (found it under Snow Leopard, so not sure if works in earlier versions).

    1. Go to System Preferences > Accounts
    2. Click on your account photo and select “Edit Picture…”, than
    3. Go to Edit>Copy

    The photo is now on the clipboard. To verify you can go to finder than Edit > Show Clipboard. You can use it anywhere to paste it into documents.

    To save it as a file: 1. Start Preview 2. Goto File>New From Clipboard (or just hit Command-N) 3. Save

  23. Noach Magedman says:

    Also try ~/Library/Images/iChat Recent Pictures/Recent *.tiff and Recents.plist

    I’m running OSX 10.6.4. For me, I have a file “/Library/Caches/com.apple.user501pictureCache.tiff”, but it’s an old photo. I’ve long since changed my account photo to something else, and just now changed it again. The iChat Recent Pictures folder has my newest photo. Note that the ~/Library folder is not group/other readable, so it’s unlikely that this is the sole location where the image is stored.

  24. Noach Magedman says:

    FOUND IT!

    Starting with Snow Leopard (10.6), the definitive location for user’s account icon is as a base64 encoded field inside a plist (XML) file! I’m still reading the man page on dscl(1) to see if there is a simple way to access the image with one command, but to do it manually:

    1) Copy /var/db/dslocal/nodes/Default/users/{USERNAME}.plist . You must be root to access this.

    2) Edit the copy and locate the base64 encoded blob under the “jpegphoto” key. Remove everything before and after that blob. Save it as myphoto.base64

    3) Decode the base64 into an image: $ openssl enc -base64 -d < myphoto.base64 > myphoto.jpg

  25. Noach Magedman says:

    oh….but I’m just being dense. Marcin’s way is so much easier. Never mind……….

  26. Mark Jen says:

    Dude you’re google famous! I found this post when I was searching for this exact thing to update my goog+ profile photo 🙂

  27. ben says:

    cheers marcin! that worked where other things didn’t

  28. Leroy says:

    Stumbled on this site after trying to search a reason for my Mountain Lion dilemma. It seems after a Snow Leopard to Mountain Lion upgrade I no longer have any of the default system image icons for User Accounts, Contacts etc. I’ve posted it on Apples Support Communities, see post here ( https://discussions.apple.com/thread/4201782 ), but you seem to have at least identified there location… I think. Can you shed some more light on this particular subject, please.

Comments are closed.