Yes, You Can Take Your Own Passport Photo
On our site, we first recommend for people to get their passport photos taken at CVS or another local business that offers the service. However, it is legal and an option for you to take your own passport photo, but here are some strict guidelines that you need to meet for the photos to be accepted.
If you need the requirements, you can get them at the U.S. Department of State official site.
Here is a handy overview from Lynda.com that shows how to do your passport photos.