Getting all the moisture out of compressed air can be a challenge, guys often end up spending more on dryer equipment than they did on their compressors.
A membrane dryer, as c4o mentioned, may or may not work depending on the quality of the filter, cfm requirements, and relative humidity of the ambient air. I tried just a small filter that looked like a glass bowl with a gold-colored hard filter inside. It removed some moisture but allowed some through as well. I had water spitting out of my pneumatic tools. If you connected two or three quality membrane filters in series you might eliminate the moisture and oil sludge from the air.
Desiccant dryers use a moisture-trapping medium inside a canister. They're very effective but require periodic maintenance to replace the contents.
Lowering the air temp of compressed air is another way of removing moisture, but it's expensive. Compressing air creates heat, and hot air retains moisture. I've measured outlet air temps on my compressor in excess of 200 degrees. Each 20 degrees that air is cooled allows 50 percent of the entrained moisture to drop out. Refrigerated dryers are used in commercial applications but not worth the money for most home mechanics.
I've been working on an air dryng system for a few months for my two stage compressor. The first stage compressed air is run through a simple fan-cooled condensor to lower the air temp before it goes into the second high pressure cylinder. Then it exits the second stage and goes through a refrigerated aftercooler and into the storage tank. Air exiting the tank then goes through a membrane filter and a desiccant filter before it gets to the end of the hose. It's effective, but more work than most guys are willing to take on.
For your use, I would look at a large quality membrane filter followed by a desiccant dryer. It's not something you can go cheap on though, painting with air that contains moisture and oil vapor is a lost cause.