Skip to content

Commit 721775d

Browse files
deven96nevikashah
authored andcommitted
IMAGES-1735: Adding segment to documentation (#24760)
1 parent f922ce9 commit 721775d

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

src/content/docs/images/transform-images/transform-via-url.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ You must specify at least one option. Options are comma-separated (spaces are no
115115

116116
<Render file="saturation" product="images" />
117117

118+
### `segment`
119+
120+
<Render file="segment" product="images" />
121+
118122
### `sharpen`
119123

120124
<Render file="sharpen" product="images" />
@@ -167,4 +171,4 @@ If Custom Cache Keys are used for the origin image, the origin image might not b
167171

168172
Resized images follow the same caching rules as the original image they were resized from, except the minimum cache time is one hour. If you need images to be updated more frequently, add `must-revalidate` to the `Cache-Control` header. Resizing supports cache revalidation, so we recommend serving images with the `Etag` header. Refer to the [Cache docs for more information](/cache/concepts/cache-control/#revalidation).
169173

170-
Cloudflare Images does not support purging resized variants individually. URLs starting with `/cdn-cgi/` cannot be purged. However, purging of the original image's URL will also purge all of its resized variants.
174+
Cloudflare Images does not support purging resized variants individually. URLs starting with `/cdn-cgi/` cannot be purged. However, purging of the original image's URL will also purge all of its resized variants.

src/content/docs/images/transform-images/transform-via-workers.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ The `fetch()` function accepts parameters in the second argument inside the `{cf
103103

104104
<Render file="saturation" product="images" />
105105

106+
### `segment`
107+
108+
<Render file="segment" product="images" />
109+
106110
### `sharpen`
107111

108112
<Render file="sharpen" product="images" />
@@ -286,4 +290,4 @@ When testing image resizing, please deploy the script first. Resizing will not b
286290

287291
Resized images are always cached. They are cached as additional variants under a cache entry for the URL of the full-size source image in the `fetch` subrequest. Do not worry about using many different Workers or many external URLs — they do not influence caching of resized images, and you do not need to do anything for resized images to be cached correctly.
288292

289-
If you use the `cacheKey` fetch option to unify the caches of multiple source URLs, do not include any resizing options in the `cacheKey`. Doing so will fragment the cache and hurt caching performance. The `cacheKey` should reference only the full-size source image URL, not any of its resized versions.
293+
If you use the `cacheKey` fetch option to unify the caches of multiple source URLs, do not include any resizing options in the `cacheKey`. Doing so will fragment the cache and hurt caching performance. The `cacheKey` should reference only the full-size source image URL, not any of its resized versions.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
{}
3+
---
4+
import { Tabs, TabItem } from "~/components"
5+
6+
Automatically isolates the subject of an image by replacing the background with transparent pixels.
7+
8+
This feature uses an open-source model called BiRefNet through Workers AI. Read more about Cloudflare's [approach to responsible AI](https://www.cloudflare.com/trust-hub/responsible-ai/).
9+
10+
<Tabs>
11+
<TabItem label="URL format">
12+
```js
13+
segment=foreground
14+
```
15+
</TabItem>
16+
<TabItem label="Workers">
17+
```js
18+
cf: {segment: "foreground"}
19+
```
20+
</TabItem>
21+
</Tabs>

0 commit comments

Comments
 (0)