Eleven-year-old Olive Dunwoody recently moved to Linden Street with her parents. At first, she isn't sure she likes the big house and quickly finds that its many rooms hold strange paintings left by the previous owner.
Olive is afraid of the painting outside her room — something is not right about the little town in the picture. She asks her mother if they can take it down, but the painting is stuck to the wall. Olive examines other paintings in the house and discovers that they are also stuck in place. When she sees something move in a painting, she runs away.
Olive is also afraid when her mother asks her to take care of the laundry in the dark basement. Even though she turns on all the lights, she can't get rid of the feeling that she's being watched. Before she goes back upstairs, she sees a pair of green eyes in the shadows. That night, a magic cat named Horatio opens her bedroom window and speaks to her. He tells Olive that the home's true owner thinks she and her parents are intruders. Horatio leaves, and Olive wonders if he was a dream.
Olive spends her days exploring the guest rooms. She finds a pair of glasses and tries them on. She's surprised to see the portrait of a woman wink at her. On a hunch, Olive uses the glasses to look at the paintings in the hall. As she moves close to a canvas, she feels a breeze coming from it. She touches the canvas and discovers that she can step into it.
Inside the painting, she meets a little boy named Morton. He tells her that a bad man took him into the painting, and now he can't get out. Horatio arrives to lead Olive out of that painting. Because Morton is scared, Olive takes him with her as she follows Horatio. Horatio leads them to a painting of Linden Street, where he insists on leaving Morton. Morton has been in the painting so long that he's no longer a real boy.
Once outside the painting, Horatio warns Olive to be careful about using the glasses. If she loses them while she's inside a painting, she'll be trapped until a guide, such as Horatio, leads her out. He tells her to leave the paintings alone because she doesn't know what she's messing with. Olive ignores Horatio and continues to use the glasses.
As she explores the house, Olive discovers another talking cat that seems to be guarding something in the basement. A few days later, the portrait of the woman who winked at Olive invites her into the painting and introduces herself as Annabelle. Annabelle used to live in the house and tells Olive to visit her whenever she wants.
Later, Olive is outside and overhears her neighbors talking about a man named Aldous McMartin, an artist who lived in her house. She also notices that her house has an attic she hasn't explored.
Back inside, Olive searches for the attic but can't find the entrance. Something in a painting she passes sparkles, drawing her attention. Entering the picture, she finds a locket in a lake and puts it on before Horatio arrives. He tells her she won't be able to take the locket off until she's dead because now it's her responsibility to keep it safe. He advises her to keep it hidden under her clothes. Olive asks him about Aldous, but Horatio won't answer.
That night, Olive wakes to the sound of a dog whining. She follows the sound to a painting of stone arches. As she steps into the painting, she enters an attic full of painting supplies. She realizes that the attic was Aldous' studio, and he was the one who painted the strange pictures. Suddenly, a cat jumps on Olive. She learns that his name is Harvey, the guardian of the attic. When the dog begins whining again, Olive follows the sound to a painting and unties the dog. Then she returns home.
When Olive's parents leave for a mathematics conference, Olive is excited to be alone. She plans to gorge herself on ice cream before finding Horatio and making him answer her questions. She can't find the cat, so she decides to visit Morton. Morton thinks Aldous was the one who trapped him. Other people in the painting tell her not to trust the three cats because they are witches' familiars, servants that must obey their magical masters.
Olive visits Annabelle to ask her about the cats, and she also says the cats are witches' familiars and dangerous. Olive is confused because the cats have been helping her. When Annabelle starts crying and tells Olive that she lost the locket her grandfather gave her, Olive realizes the locket is the one she found in the lake. Wanting to comfort her friend, Olive suggests leaving the painting and searching the house for the necklace.
Their search leads to the painting of the lake, where Annabelle remembers leaving the locket. After Annabelle climbs into a boat with Olive and rows to the middle of the lake, she tells Olive that she is Ms. McMartin, the previous owner of the home. She knows Olive has the locket and will have it until she dies.
Using magic to leave Olive in the middle of the lake, Annabelle creates a storm in hopes of killing Olive and retrieving the locket. The storm washes Olive overboard, but she manages to swim to safety.
Horatio arrives and leads the fearful Olive back to the house. As she hides from Annabelle with Horatio and Harvey, they admit that the McMartins are witches and the cats are forced to serve them. Aldous McMartin was a bad man and learned how trap people in paintings.
Annabelle, his granddaughter, was his protégé. Aldous painted a self-portrait and instructed Annabelle to release him when he died. The real Annabelle decided not to release her grandfather because he killed her parents. But the portrait of Annabelle still plans to release her grandfather from the painting that sits inside the locket around Olive's neck. To bring Aldous back, Annabelle needs the locket, Aldous' ashes, which Leopold is guarding in the basement, and the blood from a boy who cannot die. That boy is Morton.
Annabelle gets the ashes, and using magic, forces Olive to come with her. Inside the painting with Morton, Annabelle cuts the boy's hand. With the blood, ashes and locket, Annabelle releases Aldous, but she is trapped in the painting. Aldous exits the painting in the form of a dark shadow. As he enters the house, he shrouds everything in darkness, which frightens Olive. The cats arrive and tell Olive she's their last hope to banish Aldous. She must use light get rid of the shadow. She must overcome her fear of the dark to save the day.
Lighting the way with candles and a lantern, Olive and the cats follow Aldous' trail toward the attic. Only Olive is able to enter the painting and the attic. Alone in the dark with Aldous, Olive is terrified. He tells her he wants his house back and nothing will stop him.
While Aldous is speaking, Olive thinks of her parents and musters her courage. She positions a number of mirrors that are strewn around the attic. When the time is right, she turns on the lantern she's been carrying. The light ricochets off the mirrors, filling the room with light and destroying Aldous.
With Aldous gone, the paintings are no longer stuck to the walls. Morton returns to Linden Street after Olive promises to visit him. Olive takes the painting that Annabelle is trapped in and buries it in the backyard. She walks through her house and is pleased to see that all the paintings appear to be happier places.