A new method for predicting blocking effect in the spatial domain is proposed. This method aims at estimating the appearance of blocking artefacts in the original image prior to compression for a given bit rate and a given compression technique. The basic idea is to use a training process in order to compute a visibility measure. A weighting function of the blocking effects is then derived from this training process performed on a database. The proposed method is objectively and subjectively evaluated on various actual images. The obtained results confirm the efficiency of the proposed method in predicting blocking effect.