Skip to content

Commit e2c7f8a

Browse files
committed
Add docs for color_profile processing option and IMGPROXY_COLOR_PROFILES_DIR config
1 parent 7a494d3 commit e2c7f8a

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

docs/configuration/options.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ We highly recommended reading the [Memory usage tweaks](../memory_usage_tweaks.m
703703
* [`IMGPROXY_KEEP_COPYRIGHT`]: when `true`, imgproxy will not remove copyright info while stripping metadata. Default: `true`
704704
* [`IMGPROXY_STRIP_METADATA_DPI`]: ((pro)) the DPI metadata value that should be set for the image when its metadata is stripped. Default: `72.0`
705705
* [`IMGPROXY_STRIP_COLOR_PROFILE`]: when `true`, imgproxy will transform the embedded color profile (ICC) to sRGB and remove it from the image. Otherwise, imgproxy will try to keep it as is. Default: `true`
706+
* [`IMGPROXY_COLOR_PROFILES_DIR`]: ((pro)) the path to the directory containing color profiles that can be used with the [color_profile](../usage/processing.mdx#color-profile) processing option. Default: `/usr/share/color/icc`
706707
* [`IMGPROXY_AUTO_ROTATE`]: when `true`, imgproxy will automatically rotate images based on the EXIF Orientation parameter (if available in the image meta data). The orientation tag will be removed from the image in all cases. Default: `true`
707708
* [`IMGPROXY_ENFORCE_THUMBNAIL`]: when `true` and the source image has an embedded thumbnail, imgproxy will always use the embedded thumbnail instead of the main image. Currently, only thumbnails embedded in `heic` and `avif` are supported. Default: `false`
708709
* [`IMGPROXY_RETURN_ATTACHMENT`]: when `true`, response header `Content-Disposition` will include `attachment`. Default: `false`

docs/usage/processing.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,32 @@ scp:%strip_color_profile
733733

734734
When set to `1`, `t` or `true`, imgproxy will transform the embedded color profile (ICC) to sRGB and remove it from the image. Otherwise, imgproxy will try to keep it as is. This is normally controlled by the [IMGPROXY_STRIP_COLOR_PROFILE](../configuration/options.mdx#IMGPROXY_STRIP_COLOR_PROFILE) configuration but this processing option allows the configuration to be set for each request.
735735

736+
### Color profile ((pro)) {#color-profile}
737+
738+
```imgproxy_url_option
739+
color_profile:%profile
740+
cp:%profile
741+
icc:%profile
742+
```
743+
744+
When set, imgproxy will convert the image's colorspace according to the provided color profile and embed the profile into the image.
745+
746+
`%profile` can be one of the following values:
747+
748+
* `srgb`: a built-in compact sRGB profile.
749+
* `cmyk`: a built-in "Chemical proof" CMYK profile.
750+
* A filename of a custom color profile that is located in the [IMGPROXY_COLOR_PROFILES_DIR](../configuration/options.mdx#IMGPROXY_COLOR_PROFILES_DIR) directory. The filename should be escaped (percent-encoded). The `.icc` or `.icm` extension can be omitted.
751+
752+
:::info
753+
This processing option is ignored if the resulting image format doesn't support color profiles.
754+
:::
755+
756+
:::info
757+
Color profiles embedded with this processing option are not stripped by the [strip_color_profile](#strip-color-profile) option or the [IMGPROXY_STRIP_COLOR_PROFILE](../configuration/options.mdx#IMGPROXY_STRIP_COLOR_PROFILE) configuration.
758+
:::
759+
760+
Default: blank
761+
736762
### Enforce thumbnail
737763

738764
```imgproxy_url_option

0 commit comments

Comments
 (0)