Skip to content

Commit 83f7514

Browse files
committed
docs: add fixes
1 parent a2cae3a commit 83f7514

File tree

2 files changed

+86
-118
lines changed

2 files changed

+86
-118
lines changed

docs/useful-tips/images/transform-parameters/borderValueTest.svg

Lines changed: 77 additions & 115 deletions
Loading

docs/useful-tips/transform-function-and-its-parameters.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ To understand what `borderType` is, we need to get back to interpolation for a m
9292
```ts
9393
const result = image.transform(matrix, {
9494
borderType: 'constant',
95-
borderValue: 255, // White border
95+
borderValue: 125, // Grey border
9696
});
9797
```
9898

@@ -130,17 +130,19 @@ const result2 = image.transform(rotationMatrix, {
130130
});
131131
```
132132

133-
As you can see using the same matrix images the image seems to be turned into opposite directions. Basically, with `inverse` set to `true` you kind of "revert" an image back to the states that it was before the matrix transformed.
133+
As you can see using the same matrix images the image seems to be turned into opposite directions.
134134

135135
![inverse test](./images/transform-parameters/inverseTest.svg)
136136

137137
#### Full Image
138138

139-
`fullImage` ensures that the output image is large enough to contain all transformed pixels from the source image, preventing any cropping. When true, the function automatically calculates the required output dimensions.
139+
`fullImage` ensures that the output image is large enough to contain all transformed pixels from the source image, preventing any cropping. When true, the function automatically calculates the required output dimensions. When false, source image dimensions are taken.
140140

141141
```ts
142142
//Without fullImage - may crop transformed pixels
143143
const result1 = image.transform(rotationMatrix, {
144+
width: 8,
145+
height: 10,
144146
fullImage: false,
145147
});
146148

@@ -153,3 +155,7 @@ const result2 = image.transform(rotationMatrix, {
153155
This is particularly useful for rotations, where corners of the image may extend beyond the original boundaries.
154156

155157
![fullImage test](./images/transform-parameters/fullImageTest.svg)
158+
159+
:::warning
160+
If `fullImage` is defined together with `width` and `height`, the algorithm will use dimensions calculated for `fullImage`.
161+
:::

0 commit comments

Comments
 (0)