With the invention of movie cameras it didn't take people long to work trick photography into their films.
By turning the camera on or off people could be made to vanish or appear out of thin air
, and superimposing two scenes made transparent ghosts gradually appear and then fade away
But theatregoers had seen
illusions like this long before the invention of movie cameras. One of the most famous was Pepper's Ghost named after John Pepper who first used it in theatre productions in the 1860s.
You've seen the effect
yourself in the window. When it's brighter outside you see through the window clearly but as night falls it's brighter inside and then the window behaves more like a mirror reflecting you and other things inside the room.
Manipulate the lighting and you can get something in between
A model theatre shows how Pepper did it. Part of the stage is a theatre set with backdrops, scenery and furniture. That's what the audience sees.
What they can't see is beside the stage an area painted black where the actor playing the ghost stands and can hide behind a black curtain.
Dividing the two area is a large sheet of glass at 45 degrees which sits in there.
The audience is positioned here. All they can see is the set. Its bright lighting makes the glass behave like a window but when the actor emerges, especially under a spotlight, the ghost is bright enough to make the glass act more like a mirror, and reflect his image.
This is what the audience sees as a ghost emerges from the haunted desk and walks around the room.
Pepper's Ghost illusion is still used today in magic tricks, the dashboard instruments of cars and planes and even in films to create illusions like a candle burning in a glass of water.