1. A method for denoising a noisy image z, the method comprising: computing, by an electronic computer, a prefiltered image y from the noisy image z; collecting, by an electronic computer, bias statistics for each prediction class in a context-by-context analysis of the prefiltered image y; collecting, by the electronic computer, prediction-error distributions in a context-by-context analysis of the noisy image z in which prediction-errors z i −{tilde over (x)} i are used to generate prediction-error vectors e′ k that are added to prediction-error-statistics vectors e k ; generating, by the electronic computer, normalized and smoothed prediction-error probability distributions {circumflex over (P)} E for each conditioning class; computing, by the electronic computer, for each noisy-image pixel z i an estimated clean-image symbol x i by minimizing a computed distortion over all possible symbols a 0 -a M−1 of alphabet A and storing x i in a computer-readable memory for subsequent display and/or output to a user.