tfm.vision.preprocess_ops.random_jpeg_quality
Stay organized with collections
Save and categorize content based on your preferences.
Randomly encode the image as jpeg and decode it.
tfm.vision.preprocess_ops.random_jpeg_quality(
image: tf.Tensor,
min_quality: (int | tf.Tensor) = 20,
max_quality: (int | tf.Tensor) = 100,
prob_to_apply: (float | tf.Tensor) = 0.6
) -> tf.Tensor
Args |
image
|
a uint8 'Tensor' of shape [height, width, 3] representing the input
image.
|
min_quality
|
minimum jpeg quality in range of [0, 100].
|
max_quality
|
maximum jpeg quality in range of [0, 100].
|
prob_to_apply
|
probability to apply this augmentation.
|
Returns |
|
image with jpeg quality changed
|
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. Some content is licensed under the numpy license.
Last updated 2026-11-06 UTC.
[null,null,["Last updated 2026-11-06 UTC."],[],[]]