Skip to content

Commit 2c66198

Browse files
committed
Version 4-preview
1 parent 69d0666 commit 2c66198

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5447
-360
lines changed

docs/configuration/options.mdx

Lines changed: 45 additions & 110 deletions
Large diffs are not rendered by default.

docs/features/object_detection.mdx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,34 @@ description: Learn about how to detect objects in your images and use them with
55

66
# Object detection ((pro))
77

8-
imgproxy can detect objects in the image and use them for smart cropping, blurring the detections, drawing the detections, or cropping to detected objects. You can also [fetch the detected objects info](../usage/getting_info.mdx#detect-objects).
8+
imgproxy can detect objects in the image and use them for smart cropping, blurring the detections, or drawing the detections. You can also [fetch the detected objects info](../usage/getting_info.mdx#detect-objects).
99

10-
For object purposes, imgproxy uses the YOLO (You Only Look Once) model family. imgproxy supports models in ONNX format. We provide Docker images with a model trained for face detection, but you can use any YOLO model found on the internet or train your own model.
10+
For object purposes, imgproxy uses the YOLO (You Only Look Once) model family. imgproxy supports models in DarkNet or ONNX format. We provide Docker images with a model trained for face detection, but you can use any YOLO model found on the internet or train your own model.
1111

1212
## Configuration
1313

1414
:::tip
1515
You don't need to configure object detection if you're using an imgproxy Pro Docker image with a tag suffixed with `-ml` and you want to use the face detection model. The model is already included in the image and the configuration is already set up.
1616
:::
1717

18+
:::info
19+
DarkNet model format has priority over ONNX model format. If you define both, imgproxy will use the DarkNet model.
20+
:::
21+
22+
### DarkNet model format
23+
24+
:::warning
25+
DarkNet models support is deprecated and will be removed in imgproxy v4. Please use ONNX models instead.
26+
:::
27+
28+
You need to define the following config variables to enable object detection with a [DarkNet](https://github.com/AlexeyAB/darknet) model:
29+
30+
* [`IMGPROXY_OBJECT_DETECTION_CONFIG`]: a path to the neural network config in DarkNet format
31+
* [`IMGPROXY_OBJECT_DETECTION_WEIGHTS`]: a path to the neural network weights in DarkNet format
32+
* [`IMGPROXY_OBJECT_DETECTION_CLASSES`]: a path to the [class names file](#class-names-file)
33+
34+
### ONNX model format
35+
1836
You need to define the following config variables to enable object detection with an ONNX model:
1937

2038
* [`IMGPROXY_OBJECT_DETECTION_NET`]: a path to the neural network model in ONNX format
@@ -318,20 +336,6 @@ You can make imgproxy [draw bounding boxes](../usage/processing.mdx#draw-detecti
318336
.../draw_detections:1:face/...
319337
```
320338

321-
### Crop to detected objects
322-
323-
You can make imgproxy [crop the image](../usage/processing.mdx#crop-objects) to fit all detected objects of the desired classes:
324-
325-
```imgproxy_url
326-
.../crop_objects:1.2:face:person/...
327-
```
328-
329-
This will automatically crop the image to include all detected faces and persons with 20% padding around them. You can omit class names to crop to all detected objects:
330-
331-
```imgproxy_url
332-
.../co:1.0/...
333-
```
334-
335339
### Fetch the detected objects' info
336340

337341
You can [fetch the detected objects info](../usage/getting_info.mdx#detect-objects) using the `/info` endpoint:

docs/image_formats_support.mdx

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ At the moment, imgproxy supports only the most popular image formats:
2121
| TIFF | `tiff` | :white_check_mark: | :white_check_mark: |
2222
| PDF ((pro)) | `pdf` | :white_check_mark: | [See notes](#pdf-support) |
2323
| PSD ((pro)) | `psd` | [See notes](#psd-support) | :x: |
24-
| RAW ((pro)) | | [See notes](#raw-support) | :x: |
2524
| MP4 (h264) ((pro)) | `mp4` | [See notes](#video-thumbnails) | :white_check_mark: |
2625
| Other video formats ((pro)) | | [See notes](#video-thumbnails) | :x: |
2726

@@ -37,6 +36,10 @@ imgproxy supports SVG sources without limitations, but SVG results are not suppo
3736

3837
When the source image is SVG and an SVG result is requested, imgproxy returns the source image without modifications.
3938

39+
imgproxy reads some amount of bytes to check if the source image is SVG. By default it reads a maximum of 32KB, but you can change this:
40+
41+
* `IMGPROXY_MAX_SVG_CHECK_BYTES`: the maximum number of bytes imgproxy will read to recognize SVG. If imgproxy can't recognize your SVG, try to increase this number. Default: `32768` (32KB)
42+
4043
## Animated images support
4144

4245
Since the processing of animated images is a pretty heavy process, only one frame is processed by default. You can increase the maximum of animation frames to process with the following variable:
@@ -67,12 +70,6 @@ We tested imgproxy with all variants of PSD/PSB files that we could find or prod
6770
We couldn't find any PSD/PSB files with their image data compressed with ZIP, so imgproxy renders them as solid white images. If you had such files, we would very much appreciate it if you could share them with us.
6871
:::
6972

70-
## RAW support ((pro)) {#raw-support}
71-
72-
RAW image formats from digital cameras are supported as source images only (read-only). RAW files are decoded and converted to standard image formats during processing.
73-
74-
imgproxy uses [libraw](https://www.libraw.org/) to process RAW files. For a complete list of supported camera models and RAW formats, see the [libraw supported cameras list](https://www.libraw.org/supported-cameras).
75-
7673
## Converting animated images to MP4 ((pro)) {#converting-animated-images-to-mp4}
7774

7875
Animated image results can be converted to MP4 by specifying the `mp4` extension.
@@ -87,22 +84,3 @@ Since this still requires more data to be downloaded, video thumbnail generation
8784

8885
* `IMGPROXY_ENABLE_VIDEO_THUMBNAILS`: when true, enables video thumbnail generation. Default: `false`
8986
* `IMGPROXY_VIDEO_THUMBNAIL_SECOND`: the timestamp of the frame (in seconds) that will be used for the thumbnail. Default: `1`.
90-
91-
## Colorspace and HDR preservation
92-
93-
imgproxy always preserves the source image's colorspace:
94-
95-
* Color images remain color images.
96-
* Grayscale images remain grayscale images.
97-
* Colorspace types are maintained.
98-
99-
The bit depth handling depends on the [IMGPROXY_PRESERVE_HDR](configuration/options.mdx#IMGPROXY_PRESERVE_HDR) configuration setting:
100-
101-
**When `IMGPROXY_PRESERVE_HDR` is enabled:**
102-
103-
* High bit images remain high bit in the output (eg, GRAYSCALE16 remains GRAYSCALE16, RGB16 stays RGB16, scRGB becomes RGB16)
104-
105-
**When `IMGPROXY_PRESERVE_HDR` is disabled (default):**
106-
107-
* High bit images are converted to 8-bit (eg, GRAYSCALE16 becomes GRAYSCALE8, RGB, RGB16 and scRGB become sRGB)
108-
* 8-bit images remain 8-bit

docs/image_sources/amazon_s3.mdx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ imgproxy can process images from S3 buckets. To use this feature, do the followi
1111
3. _(optional)_ Specify the [AWS region](#choosing-the-aws-region) with `IMGPROXY_S3_REGION` or `AWS_REGION`. Default: `us-west-1`
1212
4. _(optional)_ Specify the S3 endpoint with `IMGPROXY_S3_ENDPOINT`. You can also set `IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE=false` to use the virtual host style for the endpoint.
1313
5. _(optional)_ Set the `IMGPROXY_S3_USE_DECRYPTION_CLIENT` environment variable to `true` if your objects are client-side encrypted.
14-
6. Use `s3://%bucket_name/%file_key` as the source image URL.
14+
6. _(optional)_ Specify the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_ARN`.
15+
7. _(optional)_ Specify the External ID that needs to be passed in along with the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID`. This will have no effect if the assume role ARN is not specified.
16+
8. Use `s3://%bucket_name/%file_key` as the source image URL.
1517

1618
If you need to specify the version of the source object, you can use the query string of the source URL:
1719

@@ -76,17 +78,6 @@ This allows imgproxy to access buckets in any region. However, the initial reque
7678
* If your most frequently used buckets are in the same region, set the region to that one.
7779
* If your buckets are spread across multiple regions, set the region to the closest one to your imgproxy instance.
7880

79-
## Restricting bucket access
80-
81-
Restrict which S3 buckets imgproxy can access for security:
82-
83-
* `IMGPROXY_S3_ALLOWED_BUCKETS`: a comma-separated list of bucket names that imgproxy is allowed to access. When set, imgproxy will only process images from these buckets. Default: blank (all buckets allowed)
84-
* `IMGPROXY_S3_DENIED_BUCKETS`: a comma-separated list of bucket names that imgproxy is not allowed to access. When set, imgproxy will reject requests for images from these buckets. Default: blank
85-
86-
:::tip
87-
Use `IMGPROXY_S3_ALLOWED_BUCKETS` to allow trusted buckets. Use `IMGPROXY_S3_DENIED_BUCKETS` to block specific ones. If both are set, allowed buckets override denied ones.
88-
:::
89-
9081
## MinIO
9182

9283
[MinIO](https://github.com/minio/minio) is an object storage server released under Apache License v2.0. It is compatible with Amazon S3, so it can be used with imgproxy.

docs/image_sources/azure_blob_storage.mdx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,3 @@ For certificate authentication:
5050
### Using Storage Account Key
5151

5252
Alternatively, you can set `IMGPROXY_ABS_KEY` to your Azure Blob Storage account key. See the [Manage storage account access keys](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage) guide for more info.
53-
54-
## Restricting container access
55-
56-
Restrict which Azure Blob Storage containers imgproxy can access for security:
57-
58-
* `IMGPROXY_ABS_ALLOWED_BUCKETS`: a comma-separated list of container names that imgproxy is allowed to access. When set, imgproxy will only process images from these containers. Default: blank (all containers allowed)
59-
* `IMGPROXY_ABS_DENIED_BUCKETS`: a comma-separated list of container names that imgproxy is not allowed to access. When set, imgproxy will reject requests for images from these containers. Default: blank
60-
61-
:::tip
62-
Use `IMGPROXY_ABS_ALLOWED_BUCKETS` to allow trusted containers. Use `IMGPROXY_ABS_DENIED_BUCKETS` to block specific ones. If both are set, allowed containers override denied ones.
63-
:::

docs/image_sources/google_cloud_storage.mdx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,3 @@ Otherwise, set `IMGPROXY_GCS_KEY` environment variable to the content of Google
3636
:::warning
3737
For security reasons, imgproxy accepts only service account keys for Google Cloud Storage integration.
3838
:::
39-
40-
## Restricting bucket access
41-
42-
Restrict which GCS buckets imgproxy can access for security:
43-
44-
* `IMGPROXY_GCS_ALLOWED_BUCKETS`: a comma-separated list of bucket names that imgproxy is allowed to access. When set, imgproxy will only process images from these buckets. Default: blank (all buckets allowed)
45-
* `IMGPROXY_GCS_DENIED_BUCKETS`: a comma-separated list of bucket names that imgproxy is not allowed to access. When set, imgproxy will reject requests for images from these buckets. Default: blank
46-
47-
:::tip
48-
Use `IMGPROXY_GCS_ALLOWED_BUCKETS` to allow trusted buckets. Use `IMGPROXY_GCS_DENIED_BUCKETS` to block specific ones. If both are set, allowed buckets override denied ones.
49-
:::

docs/image_sources/openstack_swift.mdx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,3 @@ imgproxy can process images from OpenStack Object Storage, also known as Swift.
2020
:::tip
2121
If filenames in your OpenStack Object Storage may contain `?`, you may want to set [IMGPROXY_SOURCE_URL_QUERY_SEPARATOR](../configuration/options.mdx#IMGPROXY_SOURCE_URL_QUERY_SEPARATOR) to another string that is not used in filenames or set it to blank to disable query string extraction.
2222
:::
23-
24-
## Restricting container access
25-
26-
Restrict which Swift containers imgproxy can access for security:
27-
28-
* `IMGPROXY_SWIFT_ALLOWED_BUCKETS`: a comma-separated list of container names that imgproxy is allowed to access. When set, imgproxy will only process images from these containers. Default: blank (all containers allowed)
29-
* `IMGPROXY_SWIFT_DENIED_BUCKETS`: a comma-separated list of container names that imgproxy is not allowed to access. When set, imgproxy will reject requests for images from these containers. Default: blank
30-
31-
:::tip
32-
Use `IMGPROXY_SWIFT_ALLOWED_BUCKETS` to allow trusted containers. Use `IMGPROXY_SWIFT_DENIED_BUCKETS` to block specific ones. If both are set, allowed containers override denied ones.
33-
:::

docs/monitoring/datadog.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ imgproxy can send its metrics to Datadog. To use this feature, do the following:
2323
* `DD_TRACE_STARTUP_LOGS`: causes various startup info to be written when the tracer starts. Default: `true`
2424
* `DD_TRACE_DEBUG`: enables detailed logs. Default: `false`
2525
4. _(optional)_ Set the `IMGPROXY_DATADOG_ENABLE_ADDITIONAL_METRICS` environment variable to `true` to collect the [additional metrics](#additional-metrics).
26-
5. _(optional)_ Set the `IMGPROXY_DATADOG_PROPAGATE_EXTERNAL` environment variable to `true` to propagate Datadog tracing headers to external requests such as image downloads. Default: `false`.
2726

2827
imgproxy will send the following info to Datadog:
2928

docs/monitoring/new_relic.mdx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ imgproxy can send its metrics to New Relic. To use this feature, do the followin
1010
2. Set the `IMGPROXY_NEW_RELIC_KEY` environment variable to the license key.
1111
3. _(optional)_ Set the `IMGPROXY_NEW_RELIC_APP_NAME` environment variable to be the desired application name.
1212
4. _(optional)_ Set the `IMGPROXY_NEW_RELIC_LABELS` environment variable to be the desired list of labels. Example: `label1=value1;label2=value2`.
13-
5. _(optional)_ Set the `IMGPROXY_NEW_RELIC_PROPAGATE_EXTERNAL` environment variable to `true` to propagate New Relic tracing headers to external requests such as image downloads. Default: `false`.
1413

1514
imgproxy will send the following info to New Relic:
1615

@@ -21,15 +20,15 @@ imgproxy will send the following info to New Relic:
2120
* Image processing time
2221
* Errors that occurred while downloading and processing an image
2322

24-
Additionally, imgproxy sends the following metrics over [Metrics API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/introduction-metric-api/) as timescales (all metric names are prefixed with `Custom/imgproxy/`):
23+
Additionally, imgproxy sends the following metrics over [Metrics API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/introduction-metric-api/):
2524

26-
* `workers`: the configured number of imgproxy workers
27-
* `requests_in_progress`: the number of requests currently in progress
28-
* `images_in_progress`: the number of images currently in progress
29-
* `workers_utilization`: the percentage of imgproxy's workers utilization. Calculated as `requests_in_progress / workers * 100`
30-
* `buffer/size`: a summary of the download buffers sizes (in bytes)
31-
* `buffer/default_size`: calibrated default buffer size (in bytes)
32-
* `buffer/max_size`: calibrated maximum buffer size (in bytes)
33-
* `vips/memory`: libvips memory usage (in bytes)
34-
* `vips/max_memory`: libvips maximum memory usage (in bytes)
35-
* `vips/allocs`: the number of active vips allocations
25+
* `imgproxy.workers`: the configured number of imgproxy workers
26+
* `imgproxy.requests_in_progress`: the number of requests currently in progress
27+
* `imgproxy.images_in_progress`: the number of images currently in progress
28+
* `imgproxy.workers_utilization`: the percentage of imgproxy's workers utilization. Calculated as `imgproxy.requests_in_progress / imgproxy.workers * 100`
29+
* `imgproxy.buffer.size`: a summary of the download buffers sizes (in bytes)
30+
* `imgproxy.buffer.default_size`: calibrated default buffer size (in bytes)
31+
* `imgproxy.buffer.max_size`: calibrated maximum buffer size (in bytes)
32+
* `imgproxy.vips.memory`: libvips memory usage (in bytes)
33+
* `imgproxy.vips.max_memory`: libvips maximum memory usage (in bytes)
34+
* `imgproxy.vips.allocs`: the number of active vips allocations

0 commit comments

Comments
 (0)