The forerunner to the photographic camera was the camera obscura. Camera obscura (Latin for "dark room") is the natural optical phenomenon that occurs when an image of a scene at the other side of a screen (or for instance a wall) is projected through a small hole in that screen and forms an inverted image (left to right and upside down) on a surface opposite to the opening.

Ibn al-Haytham (c. 965–1040 AD), an Arab physicist also known as Alhazen, wrote very influential essays about the camera obscura, including experiments with light through a small opening in a darkened room. The invention of the camera has been traced back to the work of Ibn al-Haytham, who is credited with the invention of the pinhole camera. While the effects of a single light passing through a pinhole had been described earlier, Ibn al-Haytham gave the first correct analysis of the camera obscure, including the first geometrical and quantitative descriptions of the phenomenon, and was the first to use a screen in a dark room so that an image from one side of a hole in the surface could be projected onto a screen on the other side.He also first understood the relationship between the focal point and the pinhole, and performed early experiments with afterimage.

Before the development of the photographic camera, it had been known for hundreds of years that some substances, such as silver salts, darkened when exposed to sunlight. In a series of experiments, published in 1727, the German scientist Johann Heinrich Schulze demonstrated that the darkening of the salts was due to light alone, and not influenced by heat or exposure to air.

The Swedish chemist Carl Wilhelm Scheele showed in 1777 that silver chloride was especially susceptible to darkening from light exposure and that once darkened, it becomes insoluble in an ammonia solution. The first person to use this chemistry to create images was Thomas Wedgwood. To create images, Wedgwood placed items, such as leaves and insect wings, on ceramic pots coated with silver nitrate, and exposed the set-up to light.

The first permanent photograph of a camera image was made in 1825 by Joseph Nicéphore Niépce using a sliding wooden box camera made by Charles and Vincent Chevalier in Paris.

Niépce had been experimenting with ways to fix the images of a camera obscura since 1816. The photograph Niépce succeeded in creating shows the view from his window. It was made using an 8-hour exposure on pewter coated with bitumen. Niépce called his process "heliography". Niépce corresponded with the inventor Louis-Jacques-Mandé Daguerre, and the pair entered into a partnership to improve the heliographic process. Niépce had experimented further with other chemicals, to improve contrast in his heliographs. Daguerre contributed an improved camera obscura design, but the partnership ended when Niépce died in 1833.

Daguerre succeeded in developing a high-contrast and extremely sharp image by exposing on a plate coated with silver iodide and exposing this plate again to mercury vapor. By 1837, he was able to fix the images with a common salt solution. He called this process Daguerreotype and tried unsuccessfully for a couple of years to commercialize it. Eventually, with the help of the scientist and politician François Arago, the French government acquired Daguerre's process for public release. In exchange, pensions were provided to Daguerre as well as Niépce's son, Isidore.

In the 1830s, the English scientist William Henry Fox Talbot independently invented a process to fix camera images using silver salts. Although dismayed that Daguerre had beaten him to the announcement of photography, on January 31, 1839, he submitted a pamphlet to the Royal Institution entitled Some Account of the Art of Photogenic Drawing, which was the first published description of photography.

The first photographic camera developed for commercial manufacture was a daguerreotype camera, built by Alphonse Giroux in 1839. Giroux signed a contract with Daguerre and Isidore Niépce to produce the cameras in France, with each device and accessories costing 400 francs. The camera was a double-box design, with a landscape lens fitted to the outer box, and a holder for ground glass focusing screen and image plate on the inner box. By sliding the inner box, objects at various distances could be brought to as sharp a focus as desired. After a satisfactory image had been focused on the screen, the screen was replaced with a sensitized plate. A knurled wheel controlled a copper flap in front of the lens, which functioned as a shutter. The early daguerreotype cameras required long exposure times, which in 1839 could be from 5 to 30 minutes.

In Germany, Peter Friedrich Voigtländer designed an all-metal camera with a conical shape that produced circular pictures of about 3 inches in diameter. The distinguishing characteristic of the Voigtländer camera was its use of a lens designed by Joseph Petzval. The f/3.5 Petzval lens was nearly 30 times faster than any other lens of the period and was the first to be made specifically for portraiture. Its design was the most widely used for portraits until Carl Zeiss introduced the anastigmat lens in 1889.

After the introduction of the Giroux daguerreotype camera, other manufacturers quickly produced improved variations. Charles Chevalier, who had earlier provided Niépce with lenses, created in 1841 a double-box camera using a half-sized plate for imaging. Chevalier's camera had a hinged bed, allowing for half of the bed to fold onto the back of the nested box. In addition to having increased portability, the camera had a faster lens, bringing exposure times down to 3 minutes, and a prism at the front of the lens, which allowed the image to be laterally correct.

Another French design emerged in 1841, created by Marc Antoine Gaudin. The Nouvel Appareil Gaudin camera had a metal disc with three differently-sized holes mounted on the front of the lens. Rotating to a different hole effectively provided variable f-stops, allowing different amounts of light into the camera. Instead of using nested boxes to focus, the Gaudin camera used nested brass tubes.

The collodion wet plate process that gradually replaced the daguerreotype during the 1850s required photographers to coat and sensitize thin glass or iron plates shortly before use and expose them in the camera while still wet. Early wet plate cameras were very simple and little different from Daguerreotype cameras, but more sophisticated designs eventually appeared. The Dubroni of 1864 allowed the sensitizing and developing of the plates to be carried out inside the camera itself rather than in a separate darkroom.

The use of photographic film was pioneered by George Eastman, who started manufacturing paper film in 1885 before switching to celluloid in 1889. His first camera, which he called the "Kodak," was first offered for sale in 1888.

In 1900, Eastman took mass-market photography one step further with the Brownie, a simple and very inexpensive box camera that introduced the concept of the snapshot. The Brownie was extremely popular and various models remained on sale until the 1960s.

Oskar Barnack, who was in charge of research and development at Leitz, decided to investigate using a 35 mm cine film for still cameras while attempting to build a compact camera capable of making high-quality enlargements. He built his prototype 35 mm camera (Ur-Leica) around 1913, though further development was delayed for several years by World War I.

The first practical reflex camera was the Franke & Heidecke Rolleiflex medium format TLR of 1928. Though both single- and twin-lens reflex cameras had been available for decades, they were too bulky to achieve much popularity. The Rolleiflex, however, was sufficiently compact to achieve widespread popularity and the medium-format TLR design became popular for both high- and low-end cameras.

The first camera to feature automatic exposure was the selenium light meter-equipped, fully automatic Super Kodak Six-20 pack of 1938, but its extremely high price (for the time) of $225 (equivalent to $4,087 in 2019) kept it from achieving any degree of success. By the 1960s, however, low-cost electronic components were commonplace and cameras equipped with light meters and automatic exposure systems became increasingly widespread.

Kodak got into the market with the Retina I in 1934, which introduced the 135 cartridges used in all modern 35 mm cameras. Although the Retina was comparatively inexpensive, 35 mm cameras were still out of reach for most people, and roll film remained the format of choice for mass-market cameras. This changed in 1936 with the introduction of the inexpensive Argus A and to an even greater extent in 1939 with the arrival of the immensely popular Argus C3. Although the cheapest cameras still used roll film, 35 mm film had come to dominate the market by the time the C3 was discontinued in 1966.

The first major post-war SLR innovation was the eye-level viewfinder, which first appeared on the Hungarian Duflex in 1947 and was refined in 1948 with the Contax S, the first camera to use a pentaprism. Prior to this, all SLRs were equipped with waist-level focusing screens. The Duflex was also the first SLR with an instant-return mirror, which prevented the viewfinder from being blacked out after each exposure. This same time period also saw the introduction of the Hasselblad 1600F, which set the standard for medium format SLRs for decades.

While conventional cameras were becoming more refined and sophisticated, an entirely new type of camera appeared on the market in 1948. This was the Polaroid Model 95, the world's first viable instant-picture camera. Known as a Land Camera after its inventor, Edwin Land, the Model 95 used a patented chemical process to produce finished positive prints from the exposed negatives in under a minute. The Land Camera caught on despite its relatively high price and the Polaroid lineup had expanded to dozens of models by the 1960s. The first Polaroid camera aimed at the popular market, the Model 20 Swinger of 1965, was a huge success and remains one of the top-selling cameras of all time.

In 1952 the Asahi Optical Company (which later became well known for its Pentax cameras) introduced the first Japanese SLR using 135 film, the Asahiflex. Several other Japanese camera makers also entered the SLR market in the 1950s, including Canon, Yashica, and Nikon.

The basis for digital camera image sensors is metal-oxide-semiconductor (MOS) technology, which originates from the invention of the MOSFET (MOS field-effect transistor) by Mohamed M. Atalla and Dawon Kahng at Bell Labs in 1959. This led to the development of digital semiconductor image sensors, including the charge-coupled device (CCD) and later the CMOS sensor.

The next technological advance came in 1960 when the German Mec 16 SB subminiature became the first camera to place the light meter behind the lens for more accurate metering. However, through-the-lens metering ultimately became a feature more commonly found on SLRs than other types of cameras; the first SLR equipped with a TTL system was the Topcon RE Super of 1962.

The first semiconductor image sensor was the CCD, invented by Willard S. Boyle and George E. Smith at Bell Labs in 1969. While researching MOS technology, they realized that an electric charge was the analogy of the magnetic bubble and that it could be stored on a tiny MOS capacitor.

The Cromemco Cyclops, introduced as a hobbyist construction project in 1975, was the first digital camera to be interfaced to a microcomputer. Its image sensor was a modified metal-oxide-semiconductor (MOS) dynamic RAM (DRAM) memory chip.

Handheld electronic cameras, in the sense of a device meant to be carried and used as a handheld film camera, appeared in 1981 with the demonstration of the Sony Mavica (Magnetic Video Camera). This is not to be confused with the later cameras by Sony that also bore the Mavica name. This was an analog camera, in that it recorded pixel signals continuously, as videotape machines did, without converting them to discrete levels; it recorded television-like signals to a 2 × 2-inch "video floppy". In essence, it was a video movie camera that recorded single frames, 50 per disk in field mode, and 25 per disk in frame mode. The image quality was considered equal to that of then-current televisions.

The NMOS active-pixel sensor (APS) was invented by Olympus in Japan during the mid-1980s. This was enabled by advances in MOS semiconductor device fabrication, with MOSFET scaling reaching smaller micron and then sub-micron levels. The NMOS APS was fabricated by Tsutomu Nakamura's team at Olympus in 1985. The CMOS active-pixel sensor (CMOS sensor) was later developed by Eric Fossum's team at the NASA Jet Propulsion Laboratory in 1993.

Analog electronic cameras do not appear to have reached the market until 1986 with the Canon RC-701. Canon demonstrated a prototype of this model at the 1984 Summer Olympics, printing the images in the Yomiuri Shinbun, a Japanese newspaper. In the United States, the first publication to use these cameras for real reportage was USA Today, in its coverage of World Series baseball. Several factors held back the widespread adoption of analog cameras; the cost (upwards of $20,000, equivalent to $47,000 in 2019), poor image quality compared to film, and the lack of quality affordable printers. Capturing and printing an image originally required access to equipment such as a frame grabber, which was beyond the reach of the average consumer. The "video floppy" disks later had several reader devices available for viewing on a screen but were never standardized as a computer drive.

Nikon was interested in digital photography since the mid-1980s. In 1986, while presenting to Photokina, Nikon introduced an operational prototype of the first SLR-type digital camera (Still Video Camera), manufactured by Panasonic. The Nikon SVC was built around a sensor 2/3 " charge-coupled device of 300,000 pixels. Storage media, a magnetic floppy inside the camera allows recording 25 or 50 B&W images, depending on the definition. In 1988, Nikon released the first commercial DSLR camera, the QV-1000C.

The first analog electronic camera marketed to consumers may have been the Casio VS-101 in 1987. A notable analog camera produced the same year was the Nikon QV-1000C, designed as a press camera and not offered for sale to general users, which sold only a few hundred units. It recorded images in greyscale, and the quality in newspaper print was equal to film cameras. In appearance, it closely resembled a modern digital single-lens reflex camera. Images were stored on video floppy disks.

The first digital camera of any kind ever sold commercially was possibly the MegaVision Tessera in 1987 though there is not extensive documentation of its sale known.

By the late 1980s, the technology required to produce truly commercial digital cameras existed. The first true portable digital camera that recorded images as a computerized file was likely the Fuji DS-1P of 1988, which recorded a 2 MB SRAM (static RAM) memory card that used a battery to keep the data in memory. This camera was never marketed to the public.

The move to digital formats was helped by the formation of the first JPEG and MPEG standards in 1988, which allowed image and video files to be compressed for storage.

The first portable digital camera that was actually marketed commercially was sold in December 1989 in Japan, the DS-X by Fuji

The first commercially available portable digital camera in the United States was the Dycam Model 1, first shipped in November 1990. It was originally a commercial failure because it was black-and-white, low in resolution, and cost nearly $1,000 (equivalent to $2,000 in 2019). It later saw modest success when it was re-sold as the Logitech Fotoman in 1992. It used a CCD image sensor, stored pictures digitally, and connected directly to a computer for download.

In 1991, Kodak brought to market the Kodak DCS (Kodak Digital Camera System), the beginning of a long line of professional Kodak DCS SLR cameras that were based in part on film bodies, often Nikons. It used a 1.3-megapixel sensor, had a bulky external digital storage system, and was priced at $13,000 (equivalent to $24,000 in 2019). At the arrival of the Kodak DCS-200, the Kodak DCS was dubbed Kodak DCS-100.

The first consumer camera with a liquid crystal display on the back was the Casio QV-10 developed by a team led by Hiroyuki Suetaka in 1995.

The first camera that offered the ability to record video clips may have been the Ricoh RDC-1 in 1995.

The first camera to use CompactFlash was the Kodak DC-25 in 1996.

In 1999 saw the introduction of the Nikon D1, a 2.74-megapixel camera that was the first digital SLR developed entirely from the ground up by a major manufacturer, and at a cost of under $6,000 (equivalent to $10,100 in 2019) at introduction was affordable by professional photographers and high-end consumers. This camera also used Nikon F-mount lenses, which meant film photographers could use many of the same lenses they already owned.

Since 2003, digital cameras have outsold film cameras and Kodak announced in January 2004 that they would no longer sell Kodak-branded film cameras in the developed world – and 2012 filed for bankruptcy after struggling to adapt to the changing industry.