There are several types, one type is painted right on the page ends when the book is at its normal stat. A second technique is a hidden painting that can only be revealed when the pages are fanned some.
Such paintings in it's popularity were simple floral patterns or royal seals. Later in the 18th century, the paintings became landscapes. They are still in tradition today, you can find these treasures in museums and artists like Martin Frost who has produced well over 3000 Fore-edge and Miniature Paintings for the Book Trade.
It's like finding buried treasure. The magic transformation of a bright gilded book-edge into an intricate little painting and then see it fade back into a gold grain, this beautiful discovery never fails to the delight. Here is a prime examples of this exquisite work: