View source on GitHub
|
JPEG XL-encode an image.
tf.io.encode_jxl(
image, quality=95.0, effort=7, name=None
)
image is a rank-N Tensor of type uint8 or uint16 with shape batch_dims +
[height, width, channels], where channels is:
- 1: for grayscale.
- 3: for RGB.
- 4: for RGBA.
quality is a JPEG-style quality factor in [0.0, 100.0]. It is mapped
internally to a JPEG XL Butteraugli distance using the same mapping as
cjxl -q: 100.0 encodes losslessly, 95.0 (the default) is high-quality
lossy encoding matching encode_jpeg, 90.0 is visually lossless, and
lower values compress more. Quality factors are not comparable across
codecs, so a given quality will not produce the same file size or visual
quality as the same value passed to tf.io.encode_jpeg.
The effort parameter (1 to 9) controls compression effort (default 7).
Returns | |
|---|---|
A Tensor of type string.
|
View source on GitHub