def contrast_button_dec_handler(self): if self.image_contrast > self.image_enhance_min_value: # get image from stack image = self.stack[0] # calculate current image brighness and dec it by 0.1 self.image_contrast = self.image_contrast - 0.1 self.image_contrast = round(self.image_contrast, 1) # make image copy print("Contrast: {}".format(self.image_contrast)) image_copy = self.make_image_copy(image, None) # enhance image brightness image_copy = _enhance.enhance_all(image_copy, self.image_brightness, self.image_color_balance, self.image_sharpness, self.image_contrast) # update stack self.stack.append(image_copy) image_copy = self.resize_image(image_copy, 800, 500) self.update_picture_panel(image_copy) # #for testing purposes # print("After decreasing brightness") # print(str(self.stack)) else: # self.can_be_dec = False print("Image contrast is minimum")
def sharpness_button_inc_handler(self): if self.image_sharpness < self.image_enhance_max_value: # get image from stack image = self.stack[0] # calculate current image brighness and inc it by 0.1 self.image_sharpness = self.image_sharpness + 0.1 self.image_sharpness = round(self.image_sharpness, 1) # make image copy print("Sharpness: {}".format(self.image_sharpness)) image_copy = self.make_image_copy(image, None) # enhance image sharpness image_copy = _enhance.enhance_all(image_copy, self.image_brightness, self.image_color_balance, self.image_sharpness, self.image_contrast) # update stack self.stack.append(image_copy) image_copy = self.resize_image(image_copy, 800, 500) self.update_picture_panel(image_copy) # #for testing purposes # print("After Increasing brightness") # print(str(self.stack)) else: print("Image sharpness is maximum")