1. A method to reduce visual artifacts, the method comprising: providing, by a computer, a first image with a first dynamic range; predicting, by a computer, using a predictor and the first image, a second image with a second dynamic range, wherein the second dynamic range is higher than the first dynamic range; calculating, by a computer, parameters for a debanding filter based on the predictor and based on calculating, for at least one pixel of the second image, a weighted average of neighboring pixels, wherein the neighboring pixels are in a vertical and/or horizontal direction to the at least one pixel and are not immediately adjacent to other neighboring pixels or to the at least one pixel; and applying, by a computer, the debanding filter to the second image to generate an output image with the second dynamic range, wherein the calculating, by a computer, parameters for the debanding filter comprises: calculating differences between the at least one pixel of the second image and all of the neighboring pixels; and if the differences are below or equal to a threshold value for all of the neighboring pixels, applying, by a computer, the debanding filter, and the threshold value is calculated with Δ ⁡ ( LUT ⁡ ( b ) ) = t · max s k ≤ LUT ⁡ ( b ) < s k + 1 ⁢ {  LUT ⁡ ( b + 1 ) - LUT ⁡ ( b )  } wherein LUT is a look up table to convert from the first image to the second image, b is a codeword for a pixel of the first image, LUT(b) is a codeword for a pixel of the second image corresponding to the pixel of first image, t is a numerical factor, and s is a pivot point.