The ink of the octopus, or any cephalopod, is composed of highly concentrated melanin. This is the same dark pigment that we humans have, and which is responsible for skin color and the color of dark hair. It is a natural dye that cephalopods manufacture in an ink sac. Most, but not all octopuses have an ink sac and produce ink, but a few, such as the deep-sea octopuses, have lost this ability.
When the need arises, octopuses squirt this ink together with a jet of water and are able to guide the direction of the squirt. The result is a cloud of ink, which is used defensively as a visual screen or a distraction to predators. The ink also contains a compound, tyrosinase, which irritates predators' eyes and paralyzes their sense of smell temporarily.
The color of the ink (melanin) is red, but when it is more concentrated, it becomes darker, changing to brown and even to black. Since red appears black in low-light, many night active or deep-sea cephalopods produce only red or brown ink.
The ink that we use in fountain pens or ball-point pens today bears little resemblance to octopus ink. In it's simplest form, the ink we write with is a pigment or dye and a binder. The first ink for writing and drawing was invented simultaneously in China and Egypt, around 2500 BC. This first ink was made of lampblack (soot) mixed with aqueous binders. In the middle ages and up through the nineteenth century, ink was made from such ingredients as gum arabic, copperas (vitriol), gall apples (source of tannin), and water. Occasionally soot was used for making the ink black, or minerals and other pigments could be used for color.
In this century, ink has become more sophisticated and is now usually made of synthetic dyes and compounds. Ink today may combine tannic, Gallic and dilute hydrochloric acid with an iron salt, phenol, and a blue or black dye. The composition may optionally include a drying agent, an adhesion promoter, a color developer and/or a preservative. Some inks are made thicker, such as printing ink.
There is one ink that is related to cephalopods: the historical artists' ink sepia, one of the brown inks used by artists for their pen and ink drawings. Sepia is a red-brown ink made from the ink sacs of cuttlefish, which are dried and ground to a fine powder, then mixed with shellac. (The ink takes its name from the cuttlefish species Sepia officinalis.) This ink came into use in the eighteenth century and was quite popular in the nineteenth century. It is sometimes difficult to identify a true sepia ink drawing, since other brown inks were in use as well. True sepia ink is still available from specialized artists' supply houses on the Internet. The term sepia now also applies to any red-brown color similar to the color of sepia ink.