File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -205,3 +205,17 @@ Produces a 'negative' of the image.
205
205
import Image from ' example.jpg?invert'
206
206
import Image from ' exmaple.jpg?invert=true'
207
207
```
208
+ ___
209
+
210
+ ### Invert
211
+ • ** Keyword** : ` invert `
212
+ • ** Type** : _ boolean_
213
+
214
+ 'Normalizes' the image by stretching its luminance to cover the full dynamic range.
215
+ This Eenhances the output image contrast.
216
+
217
+ • ** Example** :
218
+ ``` js
219
+ import Image from ' example.jpg?invert'
220
+ import Image from ' exmaple.jpg?invert=true'
221
+ ```
Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ export * from './rotate'
4
4
export * from './flip'
5
5
export * from './flop'
6
6
export * from './blur'
7
- export * from './invert'
7
+ export * from './invert'
8
+ export * from './normalize'
Original file line number Diff line number Diff line change
1
+ import { Directive , DirectiveContext , DirectiveOptions } from "../types" ;
2
+
3
+ interface FlipOptions {
4
+ normalize : string
5
+ }
6
+
7
+ export const normalize :Directive < FlipOptions > = ( { normalize } : DirectiveOptions , ctx : DirectiveContext ) => {
8
+ if ( normalize !== '' && normalize !== 'true' ) return null
9
+
10
+ ctx . useParam ( 'normalize' )
11
+ ctx . setMetadata ( 'normalize' , true )
12
+
13
+ return function normalizeTransform ( image ) {
14
+ return image . normalize ( )
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments