[-0.5, 0.5]
See Hue for more details.
- Parameters:
img (PIL Image or Tensor) – Image to be adjusted.
If img is torch Tensor, it is expected to be in […, 1 or 3, H, W] format,
where … means it can have an arbitrary number of leading dimensions.
If img is PIL Image mode “1”, “I”, “F” and modes with transparency (alpha channel) are not supported.
Note: the pixel values of the input image has to be non-negative for conversion to HSV space;
thus it does not work if you normalize your image to an interval with negative values,
or use an interpolation that generates negative values before using this function.
hue_factor (float) – How much to shift the hue channel. Should be in
[-0.5, 0.5]. 0.5 and -0.5 give complete reversal of hue channel in
HSV space in positive and negative direction respectively.
0 means no shift. Therefore, both -0.5 and 0.5 will give an image
with complementary colors while 0 gives the original image.
- Returns:
Hue adjusted image.
- Return type:
PIL Image or Tensor