In this paper we deal with the problem of calculating Automatic Exposure (AE) in digital cameras. The main problem that often occurs when taking pictures is correct exposure setting. Typically, smartphones with built-in cameras, as well as "cheap" compact digital cameras do not offer possibility of manual exposure setting. The reason is that users do not have knowledge how to set the optimal exposure, or just simply do not want to do this. Therefore, it forces that user has to rely on automatic exposure algorithms implemented in the camera. Unfortunately, these algorithms often do not perform well what causes improperly exposed images. In this paper, new algorithms for automatic exposure are proposed with the special focus on minimizing overexposed areas in the images. We have implemented proposed algorithms and conducted experiments for their efficiency, comparing with some modern cameras or smartphones. Experimental verification (enhanced by statistical analysis) shows that proposed algorithms give statistically less overexposed areas than comparative AEs.