There has been continuous research in edge-aware filters which have found many applications in computer vision and image processing. In this paper, we propose a principled-approach for the development of edge-aware filters. The proposed approach is based on two well-established principles: 1) optimal parameter estimation and 2) Bayesian model averaging (BMA). Using this approach, we formulate the problem of filtering a pixel in a local pixel patch as an optimal estimation problem. Since a pixel belongs to multiple local patches, there are multiple estimates of the same pixel. We combine these estimates into a final estimate using BMA. We demonstrate the versatility of this approach by developing a family of BMA filters based on different settings of cost functions and log-likelihood and log-prior functions. We also present a new interpretation of the guided filter and develop a BMA guided filter which includes the guided filter as a special case. We show that BMA filters can produce similar smoothing results as those of the state-of-the-art edge-aware filters. Two BMA filters are computationally as efficient as the guided filter which is one of the fastest edge-aware filters. We also demonstrate that the BMA guided filter is better than the guided filter in preserving sharp edges. A new feature of the BMA guided filter is that the filtered image is similar to that produced by a clustering process.