Method for encoding a privacy masked image comprising a plurality of pixels into an encoded image frame of a video stream, the method comprising: receiving pixel divided image data of the image, wherein the pixel divided image data represents the pixels of the image; grouping the pixels of the image into encoding units, wherein each encoding unit comprises a plurality of neighboring pixels; receiving data defining a privacy mask masking part of the image in the interest of personal integrity, and graphical characteristics of the privacy mask, such as constant coloring, smearing or pixelization; identifying all encoding units having one or more pixels located within the privacy mask; extending the privacy mask to be aligned with the identified encoding units, thereby forming a redefined privacy mask covering the identified encoding units; generating a privacy masked image by applying the redefined privacy mask and the received graphical characteristics to the image, thereby removing information in the privacy masked region; and encoding the privacy masked image into the encoded image frame of the video stream in accordance with the following: disabling spatial prediction encoding of pixels within the redefined privacy mask of the image based on image data related to pixels outside the redefined privacy mask; disabling temporal prediction encoding of pixels within the redefined mask of the image based on image data related to pixels outside any privacy mask of any reference image frame in the video stream; and allowing temporal prediction encoding of pixels within the redefined privacy mask of the image based on image data related to pixels inside a privacy mask of a reference image frame in the video stream. receiving pixel divided image data of the image, wherein the pixel divided image data represents the pixels of the image; grouping the pixels of the image into encoding units, wherein each encoding unit comprises a plurality of neighboring pixels; receiving data defining a privacy mask masking part of the image in the interest of personal integrity, and graphical characteristics of the privacy mask, such as constant coloring, smearing or pixelization; identifying all encoding units having one or more pixels located within the privacy mask; extending the privacy mask to be aligned with the identified encoding units, thereby forming a redefined privacy mask covering the identified encoding units; generating a privacy masked image by applying the redefined privacy mask and the received graphical characteristics to the image, thereby removing information in the privacy masked region; and encoding the privacy masked image into the encoded image frame of the video stream in accordance with the following: disabling spatial prediction encoding of pixels within the redefined privacy mask of the image based on image data related to pixels outside the redefined privacy mask; disabling temporal prediction encoding of pixels within the redefined mask of the image based on image data related to pixels outside any privacy mask of any reference image frame in the video stream; and allowing temporal prediction encoding of pixels within the redefined privacy mask of the image based on image data related to pixels inside a privacy mask of a reference image frame in the video stream. disabling spatial prediction encoding of pixels within the redefined privacy mask of the image based on image data related to pixels outside the redefined privacy mask; disabling temporal prediction encoding of pixels within the redefined mask of the image based on image data related to pixels outside any privacy mask of any reference image frame in the video stream; and allowing temporal prediction encoding of pixels within the redefined privacy mask of the image based on image data related to pixels inside a privacy mask of a reference image frame in the video stream.