adjust_brightness

paddle.vision.transforms. adjust_brightness ( img, brightness_factor ) [source]

Adjusts brightness of an Image.

Parameters
  • img (PIL.Image|np.array) – Image to be adjusted.

  • brightness_factor (float) – How much to adjust the brightness. Can be any non negative number. 0 gives a black image, 1 gives the original image while 2 increases the brightness by a factor of 2.

Returns

Brightness adjusted image.

Return type

PIL.Image or np.array

Examples

import numpy as np
from PIL import Image
from paddle.vision.transforms import functional as F

fake_img = (np.random.rand(256, 300, 3) * 255.).astype('uint8')

fake_img = Image.fromarray(fake_img)

converted_img = F.adjust_brightness(fake_img, 0.4)
print(converted_img.size)