"Photography as a usable process goes back to the 1820's with the development of chemical photography," says Wikipedia. Even earlier (much earlier!), elements of photography were discovered. The pinhole camera (remember making those in elementary school?) was described in the fifth and fourth centuries B.C. by Greeks Aristotle and Euclid, and by Chinese philosopher Mo Di. Then in the sixth century A.D., a Byzantine architect named Anthemius described using the "camera obscura" in his experiments. This concept was then furthered by scientist Abu Ali Al-Hasan Ibn Al-haytham of Basra during the early eleventh century. Both of these early "cameras" were dark boxes with a small hole (pinhole), through which an image passed and was reflected on the opposite side of the box (or projected onto a screen, as in the camera obscura). The image was upside down - a similar physical process to that which happens in our eyes, when we view something. When this early image was projected onto a screen, it could then be traced to render a very precise reproduction of the original image.
Several chemicals involved in photography were discovered in the thirteenth and sixteenth centuries, and several chemical and physical processes used in photography were toyed with in the 15- and 1600s. All of this research led up to the first real photography in the early 1800's.