Objective: To develop a dual-energy (DE) algorithm with spatially varying weighting factors for material selection and noise suppression. Approach: Calibration step-phantoms, with overlapping slabs of solid water and bone with different thicknesses, were used to obtain the pre-calibrated material selection and noise reduction weighting factors. The Material selection weighting factors were calculated by finding a zero of contrast-to-noise-ratio (CNR) between regions with two overlapping materials and regions of only target material, while noise suppression weighting factors were determined by maximizing signal-to-noise ratio for overlapping regions. The pre-calibrated weighting factors were fitted with low and high energy radiograph of two Rando phantoms to create maps of material selection and noise suppression weighting factors, which used with duel energy (DE) algorithm and anti-correlated noise reduction (ACNR) algorithm to generate DE images. Three different implementations, including two different sizes of Rando phantoms and two different orientations (oblique and Anterior-Posterior), were investigated. Soft-tissue and bone only images of Rando phantoms were obtained with five combination of DE algorithms and CNR, contrast, and noise values of selected regions of interest (ROIs) were compared to evaluate the performance of the novel method: simple log subtraction (SLS), SLS with uniform ACNR, adaptive DE (aDE), aDE with uniform ACNR, and aDE & adaptive ACNR (aACNR). Main results: Compared to SLS, the aDE algorithm demonstrated improved image quality in all three orientations. CNR increased with better contrast for both soft-tissue and bone images. Implementation of aACNR algorithm resulted in further reduction of image noise and improvements in CNR at the cost of contrast. However, aACNR algorithm showed better contrast comparing to ACNR method. Significance: A novel DE algorithm was proposed, which showed improved material selection and noise suppression as compared to the conventional DE techniques and can be easily implemented in a clinical environment for real-time DE image generation.