tf.image.adjust_brightness
Stay organized with collections
Save and categorize content based on your preferences.
Adjust the brightness of RGB or Grayscale images.
tf.image.adjust_brightness(
image, delta
)
This is a convenience method that converts RGB images to float
representation, adjusts their brightness, and then converts them back to the
original data type. If several adjustments are chained, it is advisable to
minimize the number of redundant conversions.
The value delta
is added to all components of the tensor image
. image
is
converted to float
and scaled appropriately if it is in fixed-point
representation, and delta
is converted to the same data type. For regular
images, delta
should be in the range [0,1)
, as it is added to the image in
floating point representation, where pixel values are in the [0,1)
range.
Args |
image
|
RGB image or images to adjust.
|
delta
|
A scalar. Amount to add to the pixel values.
|
Returns |
A brightness-adjusted tensor of the same shape and type as image .
|
Usage Example:
import tensorflow as tf
x = tf.random.normal(shape=(256, 256, 3))
tf.image.adjust_brightness(x, delta=0.1)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.image.adjust_brightness\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/image/adjust_brightness) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/image_ops_impl.py#L1579-L1621) |\n\nAdjust the brightness of RGB or Grayscale images.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.image.adjust_brightness`](/api_docs/python/tf/image/adjust_brightness), \\`tf.compat.v2.image.adjust_brightness\\`\n\n\u003cbr /\u003e\n\n tf.image.adjust_brightness(\n image, delta\n )\n\nThis is a convenience method that converts RGB images to float\nrepresentation, adjusts their brightness, and then converts them back to the\noriginal data type. If several adjustments are chained, it is advisable to\nminimize the number of redundant conversions.\n\nThe value `delta` is added to all components of the tensor `image`. `image` is\nconverted to `float` and scaled appropriately if it is in fixed-point\nrepresentation, and `delta` is converted to the same data type. For regular\nimages, `delta` should be in the range `[0,1)`, as it is added to the image in\nfloating point representation, where pixel values are in the `[0,1)` range.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------|----------------------------------------------|\n| `image` | RGB image or images to adjust. |\n| `delta` | A scalar. Amount to add to the pixel values. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A brightness-adjusted tensor of the same shape and type as `image`. ||\n\n\u003cbr /\u003e\n\n#### Usage Example:\n\n import tensorflow as tf\n x = tf.random.normal(shape=(256, 256, 3))\n tf.image.adjust_brightness(x, delta=0.1)"]]