Ejemplo n.º 1
0
 def _image_processing(self, image):
     b = self.brightness
     assert image.dtype == numpy.uint8
     assert -1 <= b <= 1
     image = image.copy()
     with OverflowPreventer(image) as img:
         img += int(b * 256)
     return image
Ejemplo n.º 2
0
 def _image_processing(self, image):
     assert image.dtype == numpy.uint8
     image = image.copy()
     s, c = self.scale, self.center
     c = int(c * 256)
     with OverflowPreventer(image) as img:
         if s <= 1:
             img *= s
             img += int(c * (1 - s))
         else:
             img -= c * (1 - 1 / s)
             img *= s
     return image