You can repair windows, but your eyes may glaze over at the cost

Q. I live in a designated historic district with strict limits on the type of windows allowed. Many windows in my house are losing the edging around the panes. Can this be repaired, or do I have to replace the windows?

— Baltimore

A. The “edging” you refer to is glazing, a putty-type product that goes on squishy but dries in a way that seals the glass, holds it in place, and sheds water when it rains. Glazing can definitely be replaced. You do not need to replace the windows.

The big question, though, is what level of restoration you want — and can afford.

The Window Preservation Alliance, which focuses on preserving old windows, has a directory that lists restoration companies across the country.

These companies do a lot more than just install new glazing. Mylo Celsy, the owner of Corners Historic Restoration in Baltimore, said her crew typically removes the sash — the movable sections of a window — and takes them to the company’s shop. There, the crew strips the layers of old paint, which often contain lead, and removes the old glazing. If the glass isn’t cracked, they remove it and set it aside for reuse. If parts of the wood have decayed, they repair or replace the pieces, as needed. Then they reinstall the glass and add new glazing. If the old windows had a rope-and-pulley system to keep the open sash from crashing down, they replace the ropes with new brass chains, which are more durable. And when they reinstall the sash, they add weatherstripping. “The windows are totally weatherized, and they open and close easily,” Celsy said.

You can repair windows, but your eyes may glaze over at the cost

It’s a lot of work, so of course it’s not cheap. Restoring a window this way typically costs at least $1,200 and can go higher, depending on the window, Celsy said.

If you can’t afford that, there are other options. If you’re handy, you can do it yourself for just the cost of new glazing and some primer paint. There are two basic types of window glazing: oil-based, such as Dap ’33’ Window Glazing ($4.27 for an 8 oz. tub at The Home Depot) and water-based, such as Dap Latex Window Glazing ($6.20 for a 10.1 oz. tube at The Home Depot). The differences go beyond whether you need to clean up tools with mineral spirits (as you do for the oil-based product) or water (which works with the latex product).

Oil-based glazing, the traditional option, is thick enough to roll into a rope, which makes it easier to tool to a smooth finish than the more gooey latex version, which comes in a tube that fits into a caulk gun. However, if you’re just trying to fill in gaps, the latex product is the way to go, said a Dap customer service representative. For good results with the oil-based glazing, it’s important to follow the whole recommended process, which starts by painting the recess for the glass with oil-based primer, he said. That’s impossible to do with a patch job; it requires taking out the glass.

The latex product, though, can be used to fill gaps. First, remove any sections of the glazing that are cracked and loose. To help with this, use a stiff putty knife or the flat end of a painter’s 5-in-1 or 6-in-1 tool ($6.48 at The Home Depot). Be careful not to catch the knife on the glazing points, little metal tabs that sit over the glass and press into the wood and that were needed to hold the glass against the frame while the original glazing cured. When all the loose glazing is out, clean the area and let the wood dry. Then, if you even suspect that the old window paint is oil-based, brush on primer (it can be either oil-based or water-based) over the bare areas. When that dries, squeeze out the latex window glazing, using the applicator nozzle to help get a reasonably smooth bead. Follow up by tooling the glazing at an angle that matches the angle of the remaining original glazing.

Tooling the glazing is the tricky part. You might want to watch one or more YouTube videos first; type “latex window glazing” into the search box. The traditional tool for tooling is a putty knife. Another option is a 2-in-1 glazier tool ($5.98 at The Home Depot). It has a flat blade on one end and an angled blade on the other that automatically creates the desired angle. The angled blade has an opening that ejects excess glazing, reducing the chance of it sticking to the smooth surface you’re trying to create.

Latex glazing does not need to be painted, but unless your windows are white, you will want to paint the glazing to match the color. Typically, the glazing is dry and stiff enough to paint after three to seven days, depending on the weather. You can paint right over it without spreading primer paint first.

If you’re not interested in doing the repairs yourself, you may want to hire a company that tackles a variety of home repair projects. Some house-painting companies also do this kind of repair, although typically as part of a painting job.

Subscribe to the Globe’s free real estate newsletter — our weekly digest on buying, selling, and design — at pages.email.bostonglobe.com/AddressSignUp. Follow us on Facebook, Instagram, and Twitter @globehomes.