Skip to content

Commit 830ba1e

Browse files
committed
Update v4 autoquality docs
1 parent 7d18564 commit 830ba1e

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

versioned_docs/version-4-preview/configuration/options.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,12 @@ Autoquality requires the image to be saved several times. Use it only when you p
259259
* [`IMGPROXY_AUTOQUALITY_FORMAT_MIN`]: ((pro)) the minimal quality imgproxy can use per format, comma divided. Example: `jpeg=70,avif=40,webp=60`. When value for the resulting format is not set, `IMGPROXY_AUTOQUALITY_MIN` value is used. Default: `avif=60`
260260
* [`IMGPROXY_AUTOQUALITY_MAX`]: ((pro)) the maximum quality imgproxy can use. Default: 80
261261
* [`IMGPROXY_AUTOQUALITY_FORMAT_MAX`]: ((pro)) the maximum quality imgproxy can use per format, comma divided. Example: `jpeg=70,avif=40,webp=60`. When a value for the resulting format is not set, the `IMGPROXY_AUTOQUALITY_MAX` value is used. Default: `avif=65`
262-
* [`IMGPROXY_AUTOQUALITY_ALLOWED_ERROR`]: ((pro)) the allowed `IMGPROXY_AUTOQUALITY_TARGET` error. Applicable only to `dssim` and `ml` methods. Default: 0.001
262+
* [`IMGPROXY_AUTOQUALITY_ALLOWED_ERROR`]: ((pro)) the allowed `IMGPROXY_AUTOQUALITY_TARGET` error. Applicable only to `dssim` and `ml` methods. Default: 0.002
263263
* [`IMGPROXY_AUTOQUALITY_MAX_RESOLUTION`]: ((pro)) when this value is greater then zero and the resultant resolution exceeds the value, autoquality won't be used. Default: 0
264-
* [`IMGPROXY_AUTOQUALITY_JPEG_NET`]: ((pro)) the path to the neural network for JPEG.
265-
* [`IMGPROXY_AUTOQUALITY_WEBP_NET`]: ((pro)) the path to the neural network for WebP.
266-
* [`IMGPROXY_AUTOQUALITY_AVIF_NET`]: ((pro)) the path to the neural network for AVIF.
267-
* [`IMGPROXY_AUTOQUALITY_JXL_NET`]: ((pro)) the path to the neural network for JPEG XL.
264+
* [`IMGPROXY_AUTOQUALITY_JPEG_NET`]: ((pro)) the path to the neural network model for JPEG.
265+
* [`IMGPROXY_AUTOQUALITY_WEBP_NET`]: ((pro)) the path to the neural network model for WebP.
266+
* [`IMGPROXY_AUTOQUALITY_AVIF_NET`]: ((pro)) the path to the neural network model for AVIF.
267+
* [`IMGPROXY_AUTOQUALITY_JXL_NET`]: ((pro)) the path to the neural network model for JPEG XL.
268268

269269
## SVG processing
270270
* [`IMGPROXY_ALWAYS_RASTERIZE_SVG`]: when `true`, imgproxy will always rasterize SVG images unless SVG processing is not [skipped](#skip-processing). Default: `false`

versioned_docs/version-4-preview/features/autoquality.mdx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ IMGPROXY_AUTOQUALITY_FORMAT_MAX="avif=65"
8888

8989
## Autoquality with ML
9090

91-
This method is almost the same as autoquality with [DSSIM](#autoquality-by-dssim) but imgproxy will try to predict the initial quality using neural networks. This requires neural networks to be configured (see the config examlpe or the config documentation). If a neural network for the resulting format is not provided, the [DSSIM](#autoquality-by-dssim) method will be used instead.
91+
This method is almost the same as autoquality with [DSSIM](#autoquality-by-dssim), but imgproxy will try to predict the initial quality using neural network models. This requires configuring neural network models (see the config example or the config documentation). If a model for the resulting format is not provided, the [DSSIM](#autoquality-by-dssim) method will be used instead.
92+
93+
:::tip
94+
You don't need to configure autoquality neural network models if you're using an imgproxy Pro Docker image with a tag suffixed with `-ml`. Such images already have the models for JPEG, WebP, AVIF, and JPEG XL included and configured.
95+
:::
9296

9397
:::info
9498
When this method is used, imgproxy will save JPEG images with the most optimal [advanced JPEG compression](../configuration/options.mdx#advanced-jpeg-compression) settings, ignoring config and processing options.
@@ -111,15 +115,15 @@ IMGPROXY_AUTOQUALITY_MAX=80
111115
# Quality 63 for AVIF is pretty the same as 80 for JPEG
112116
IMGPROXY_AUTOQUALITY_FORMAT_MIN="avif=60"
113117
IMGPROXY_AUTOQUALITY_FORMAT_MAX="avif=65"
114-
# Neural networks paths for JPEG, WebP, AVIF, and JPEG XL
115-
IMGPROXY_AUTOQUALITY_JPEG_NET="/networks/autoquality-jpeg.pb"
116-
IMGPROXY_AUTOQUALITY_WEBP_NET="/networks/autoquality-webp.pb"
117-
IMGPROXY_AUTOQUALITY_AVIF_NET="/networks/autoquality-avif.pb"
118-
IMGPROXY_AUTOQUALITY_JXL_NET="/networks/autoquality-jxl.pb"
118+
# Neural network models paths for JPEG, WebP, AVIF, and JPEG XL
119+
IMGPROXY_AUTOQUALITY_JPEG_NET="/networks/autoquality-jpeg.onnx"
120+
IMGPROXY_AUTOQUALITY_WEBP_NET="/networks/autoquality-webp.onnx"
121+
IMGPROXY_AUTOQUALITY_AVIF_NET="/networks/autoquality-avif.onnx"
122+
IMGPROXY_AUTOQUALITY_JXL_NET="/networks/autoquality-jxl.onnx"
119123
```
120124

121125
:::info
122-
If you trust your neural network's autoquality, you may want to set `IMGPROXY_AUTOQUALITY_ALLOWED_ERROR` to 1 (the maximum possible DSSIM value). In this case, imgproxy will always use the quality predicted by the neural network.
126+
If you trust your neural network model's autoquality, you may want to set `IMGPROXY_AUTOQUALITY_ALLOWED_ERROR` to 1 (the maximum possible DSSIM value). In this case, imgproxy will always use the quality predicted by the neural network model.
123127
:::
124128

125129
### Processing options example
@@ -128,12 +132,11 @@ If you trust your neural network's autoquality, you may want to set `IMGPROXY_AU
128132
.../autoquality:ml:0.02:70:80:0.001/...
129133
```
130134

131-
## Neural networks format
135+
## Neural network models format
132136

133-
Neural networks should fit the following requirements:
134-
* Tensorflow frozen graph format
135-
* Input layer size is 416x416
136-
* Output layer size is 1x100
137-
* Output layer values are logits of quality probabilities
137+
Neural network models should fit the following requirements:
138+
* ONNX format
139+
* Input layer size is 256x256x3 (RGB pixels normalized to [0..1])
140+
* Output layer size is 1 (the predicted quality value in the [0..1] range)
138141

139-
If you're an imgproxy Pro user and you want to train your own network but you don't know how, feel free to contact the imgproxy team for instructions.
142+
If you're an imgproxy Pro user and you want to train your own model but you don't know how, feel free to contact the imgproxy team for instructions.

0 commit comments

Comments
 (0)