The idea of photography started by a dark room with a hole to let the light in and reflect the outside image.
This was used in drawing at the beginning.
Ibn Al-Haytham took the theories of Aristotle, Ptolemy and Euclid as a reference. He then confirmed the theory of vision and improved the idea of the dark room (Camera obscura) by proving that the smaller the hole, the clearer the picture would be.
Those above mentioned names are some of the scientists who worked on developing and improving photography theory after Ibn Al-Haytham. Some of who were only scientists working on the theories and others were photographers.
The first photograph ever taken was by Joseph Nicéphore Niépce in 1826.