A patent is not for any idea, it is for an invention of a (feature of a) product or a process to create a product. So at the time of its invention you can patent a camera and assorted printing kit both as products in their own right, and as a means to create a picture. The idea to create a picture in itself is not patentable (at that point in time). Pure, abstract ideas such as scientific theories or mathematical equations are not patentable.
A nice paper in IEEE Computer argued that as all software can be expressed in an expression in lambda calculus (would you not hate to do that for say an OS kernel), all software is just a collection of mathematical equations, and therefore not patentable.
You can see I have been talking to IP lawyer too much.