Example of a simple image server using Nitro IPX.
nitro devIPX enhancement, supports extracting high-definition original images of network images according to rules before proceeding to the next step
Rules: fmtHDSrc.ts
Open Config:
runtimeConfig: {
autoHD: true
}// before
- https://s.alicdn.com/@sc04/kf/H11924dfc8c5343a190912df9a1e305aci.jpg_250x250.jpg
// after
+ https://s.alicdn.com/@sc04/kf/H11924dfc8c5343a190912df9a1e305aci.jpghttp://localhost:3000/enlarge,f_jpg,s_800x800/https://s.alicdn.com/@sc04/kf/H11924dfc8c5343a190912df9a1e305aci.jpg
http://localhost:3000/enlarge,f_png,s_800x800/https://s.alicdn.com/@img/imgextra/i2/O1CN01Zsnn5f28yyAQPbYyz_!!6000000008002-55-tps-70-70.svg
http://localhost:3000/f_webp,a/https://ae01.alicdn.com/kf/S9fd4c35883ff4266b6101db3b93d99d0N/200x200.gif
| Property | Docs | Example | Comments |
|---|---|---|---|
| width / w | Docs | /width_200/bliss.jpg | |
| height / h | Docs | /height_200/bliss.jpg | |
| resize / s | Docs | /s_200x200/bliss.jpg | |
| kernel | Docs | /s_200x200,kernel_nearest/bliss.jpg | Supported kernel: nearest, cubic, mitchell, lanczos2 and lanczos3 (default). |
| fit | Docs | /s_200x200,fit_outside/bliss.jpg | Sets fit option for resize. |
| position / pos | Docs | /s_200x200,pos_top/bliss.jpg | Sets position option for resize. |
| trim | Docs | /trim_100/bliss.jpg | |
| extend | Docs | /extend_{left}_{top}_{width}_{height}/bliss.jpg /extend_10_10_10_10,b_00ff00/bliss.jpg |
Extend / pad / extrude one or more edges of the image with either the provided background colour or pixels derived from the image. |
| background / b | _ | /r_45,b_00ff00/bliss.jpg | |
| extract | Docs | /extract_{left}_{top}_{width}_{height}/bliss.jpg |
Extract/crop a region of the image. |
| format / f | Docs | /format_webp/bliss.jpg | Supported format: jpg, jpeg, png, webp, avif, gif, heif, tiff and auto (experimental only with middleware) |
| quality / q | _ | /quality_50/bliss.jpg | Accepted values: 0 to 100 |
| rotate | Docs | /rotate_45/bliss.jpg | |
| enlarge | _ | /enlarge,s_2000x2000/bliss.jpg | Allow the image to be upscaled. By default the returned image will never be larger than the source in any dimension, while preserving the requested aspect ratio. |
| flip | Docs | /flip/bliss.jpg | |
| flop | Docs | /flop/bliss.jpg | |
| sharpen | Docs | /sharpen_9/bliss.jpg | |
| median | Docs | /median_10/bliss.jpg | |
| blur | Docs | /blur_5/bliss.jpg | |
| gamma | Docs | /gamma_3/bliss.jpg | |
| negate | Docs | /negate/bliss.jpg | |
| normalize | Docs | /normalize/bliss.jpg | |
| threshold | Docs | /threshold_10/bliss.jpg | |
| tint | Docs | /tint_{r}_{g}_{b}_{a}/bliss.jpg /tint_255_255_255/bliss.jpg |
|
| grayscale | Docs | /grayscale/bliss.jpg | |
| animated / a | - | /animated/giphy.gif | Experimental |

