Readonly
modifiersDefines the brightness, contrast, and saturation.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#adjust-idadjust for the imgproxy documentation
Rest
...options: [options: AdjustOptions]pb().adjust({
brightness: 100, // optional
contrast: 0.8, // optional
saturation: 0.9 // optional
});
Automatically rotates the image based on the EXIF orientation parameter.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#auto-rotate for the imgproxy documentation
pb().autoRotate();
Fills the image background with the specified color.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#background for the imgproxy documentation
Rest
...options: [options: BackgroundOptions]pb().background('ff0000');
pb().background({
r: 255,
g: 0,
b: 0
});
Adds alpha channel to background.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#background-alpha-idbackground-alpha for the imgproxy documentation
Rest
...options: [percentage: number]pb().backgroundAlpha(0.4);
Applies a gaussian blur filter to the image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#blur for the imgproxy documentation
Rest
...options: [sigma: number]pb().blur(10);
Detects objects of the provided classes and blurs them.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#blur-detections-idblur-detections for the imgproxy documentation
Rest
...options: [options: BlurDetectionOptions]pb().blurDetections({
sigma: 10,
classNames: ['face']
});
Adjusts the brightness of an image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#brightness-idbrightness for the imgproxy documentation
Rest
...options: [value: number]pb().brightness(-100);
Builds the imgproxy URL
If a path is supplied, the full URL path will be returned, else only the stringified modifiers will be returned.
If a base URL is supplied, the full imgproxy URL will be returned.
Optional
options: BuildOptionsThe build options
The imgproxy URL
Adds a cache buster to the imgproxy params.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#cache-buster for the imgproxy documentation
Rest
...options: [buster: string]pb().cacheBuster("abcdef123");
Creates a new param builder instance with a copy of the current modifiers
A copy of this param builder
Adjust contrast of the resulting image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#contrast-idcontrast for the imgproxy documentation
Rest
...options: [percentage: number]pb().contrast(0.3);
Crops the image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#crop for the imgproxy documentation
Rest
...options: [options?: CropOptions]pb().crop({
width: 100, // optional
height: 50, // optional
gravity: { // optional
type: GravityType.CENTER, // required
offset: { // optional
x: 20, // required
y: 20 // required
}
}
})
Use a single frame of animated images.
See https://github.com/imgproxy/imgproxy/blob/cfa4b596d1f31656f9116cc16f2a4ff7d15c2837/docs/generating_the_url.md#disable-animation-iddisable-animation for the imgproxy documentation
Rest
...options: []pb().disableAnimation();
When set, imgproxy will replace the image's DPI metadata with the provided value.
See https://github.com/imgproxy/imgproxy/blob/8629c5eca1e422908363f471513bfc887d778a85/docs/generating_the_url.md#dpi-iddpi for the imgproxy documentation
Rest
...options: [value: number]pb().dpi(300);
Multiplies the dimensions according to the specified factor.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#dpr for the imgproxy documentation
Rest
...options: [value: number]pb().dpr(18);
Detects objects of the provided classes and draws their bounding boxes.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#draw-detections-iddraw-detections for the imgproxy documentation
Rest
...options: [options: DrawDetectionOptions]pb().drawDetections({
classNames: ["face"]
});
If the source image has an embedded thumbnail, imgproxy will use the embedded thumbnail instead of the main image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#enforce-thumbnail for the imgproxy documentation
pb().enforceThumbnail();
Enlarges the image if it is smaller than the given size.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#enlarge for the imgproxy documentation
pb().enlarge();
Returns a 404 if the expiration date is reached.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#expires for the imgproxy documentation
Rest
...options: [options: ExpiresOptions]pb().expires(new Date());
pb().expires(1661431326);
Extends the image if it is smaller than the given size.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#extend for the imgproxy documentation
Rest
...options: [options?: ExtendOptions]pb().extend();
pb().extend({
gravity: {
type: GravityType.NORTH // required
offset: { // optional
x: 10; // required
y: 20; // required
}
}
});
Extends the image to the requested aspect ratio.
See https://github.com/imgproxy/imgproxy/blob/1a9768a2c682e88820064aa3d9a05ea234ff3cc4/docs/generating_the_url.md#extend-aspect-ratio for the imgproxy documentation
Rest
...options: [options?: ExtendAspectRatioOptions]pb().extendAspectRatio();
pb().extendAspectRatio({
gravity: {
type: GravityType.NORTH // required
offset: { // optional
x: 10; // required
y: 20; // required
}
}
});
Sets a custom fallback image by specifying its URL.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#fallback-image-url-idfallback-image-url for the imgproxy documentation
Rest
...options: [url: string]pb().fallbackImageUrl('https://example.com');
Sets the filename for the Content-Disposition header.
See https://github.com/imgproxy/imgproxy/blob/41b9ebe9277ef3e664e0a842fbc0e912b2640969/docs/generating_the_url.md#filename for the imgproxy documentation
Rest
...options: [name: string, base64Encoded: boolean]// Not encoded
pb().fileName('filename.png');
// Encoded
pb().fileName('ZmlsZW5hbWUucG5n', true);
Specifies the resulting image format.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#format for the imgproxy documentation
Rest
...options: [imageFormat: FormatOptions]pb().format('png');
Sets the desired quality for each format.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#format-quality for the imgproxy documentation
Rest
...options: [options: FormatQualityOptions]pb().formatQuality({
jpeg: 100,
png: 50,
// ...
});
Private
getGet the extension for the file. Checks the specified format and the target image.
See https://github.com/imgproxy/imgproxy/blob/5ac79477dfa76ed3c014a1472e31e26a2d2257a0/docs/generating_the_url.md#source-url for the imgproxy documentation
An extension if found, or an empty string
Allows redefining GIF saving options.
Rest
...options: [options: GifOptions]Automatically applied since version 3.0.0
pb().gifOptions({
optimizeFrames: true, // optional
optimizeTransparency: 50 // optional
});
Places a gradient on the processed image.
See https://github.com/imgproxy/imgproxy/blob/cfa4b596d1f31656f9116cc16f2a4ff7d15c2837/docs/generating_the_url.md#gradient-idgradient for the imgproxy documentation
Rest
...options: [options: GradientOptions]pb().gradient({
opacity: 1, // required
color: 'ababab', // optional
direction: 'up', // optional
start: 0.0, // optional
stop: 0.7 // optional
});
Sets the gravity.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#gravity for the imgproxy documentation
Rest
...options: [options: GravityOptions]pb().gravity({
type: GravityType.NORTH // required
offset: { // optional
x: 10, // required
y: 20 // required
}
});
When hashsum_type
is not none
, imgproxy will calculate the hashsum of the source image
and compare it with the provided hashsum.
See https://github.com/imgproxy/imgproxy-docs/blob/f9d7908d253ec2b31425b988a48f8c28cb271c58/docs/usage/processing.mdx#L916 for the imgproxy documentation
Rest
...options: [options: HashsumOptions]pb().hashsum({
hashsum: 'ABCDEF', // required
type: HashsumType.NONE // optional
});
Allows redefining JPEG saving options.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#jpeg-options-idjpeg-options for the imgproxy documentation
Rest
...options: [options: JpegOptions]pb().jpegOptions({
progressive: boolean, // optional
noSubsample: boolean, // optional
trellisQuant: boolean, // optional
overshootDeringing: boolean, // optional
optimizeScans: boolean, // optional
quantizationTable: 7 // optional
});
Preserve the copyright info while stripping metadata.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#keep-copyright for the imgproxy documentation
pb().keepCopyright();
Limits the file size to the specified number of bytes.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#max-bytes for the imgproxy documentation
Rest
...options: [bytes: number]pb().maxBytes(10);
Defines the minimum height of the resulting image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#min-height for the imgproxy documentation
Rest
...options: [height: number]pb().minHeight(100);
Defines the minimum width of the resulting image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#min-width for the imgproxy documentation
Rest
...options: [width: number]pb().minWidth(100);
Applies the specified padding to the image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#padding for the imgproxy documentation
Rest
...options: [options: PaddingOptions]pb().pad({
top: 100, // optional (Note: sets all other sides if not set explicitly)
right: 100, // optional
bottom: 10, // optional
left: 10 // optional
});
When source image supports pagination (PDF, TIFF) or animation (GIF, WebP), this option allows specifying the page to use.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#page-idpage for the imgproxy documentation
Rest
...options: [pg: number]pb().page(10);
Apply the pixelate filter to the resulting image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#pixelate for the imgproxy documentation
Rest
...options: [pixelSize: number]pb().pixelate(5);
Allows redefining PNG saving options.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#png-options-idpng-options for the imgproxy documentation
Rest
...options: [options: PngOptions]pb().pngOptions({
interlaced: true, // optional
quantize: false, // optional
quantization_colors: 10 // optional
});
Sets one or many presets to be used by the imgproxy.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#preset for the imgproxy documentation
Rest
...options: [presets: PresetOptions]pb().preset('mypreset');
pb().preset(['preset1', 'preset2']);
Redefines the quality of the resulting image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#quality for the imgproxy documentation
Rest
...options: [percentage: number]pb().quality(80);
Returns a raw unprocessed and unchecked source image
See https://github.com/imgproxy/imgproxy/blob/f95f57bb4df35c69ae2257958006ef54b1c1d8c7/docs/generating_the_url.md#raw for the imgproxy documentation
Rest
...options: []pb().raw();
Resizes the image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#resize for the imgproxy documentation
Rest
...options: [options: ResizeOptions]pb().resize({
type: ResizeType.AUTO, // optional
width: 100, // optional
height: 50 // optional
});
Defines the algorithm that imgproxy will use for resizing.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#resizing-algorithm-idresizing-algorithm for the imgproxy documentation
Rest
...options: [algorithm: ResizingAlgorithm]pb().resizingAlgorithm(ResizingAlgorithm.NEAREST));
Returns attachment in the Content-Disposition header.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#return-attachment for the imgproxy documentation
pb().returnAttachment();
Rotates the image by the specified angle.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#rotate for the imgproxy documentation
Rest
...options: [angle: RotationOptions]pb().rotate(90);
Adjust saturation of the resulting image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#saturation-idsaturation for the imgproxy documentation
Rest
...options: [percentage: number]pb().saturation(0.3);
Applies a sharpen filter to the image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#sharpen for the imgproxy documentation
Rest
...options: [sigma: number]pb().sharpen(3);
Skip the processing of the listed formats.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#skip-processing for the imgproxy documentation
Rest
...options: [extensions: SkipProcessingOptions]pb().skipProcessing(['png', 'svg']);
Strips the color profile from the image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#strip-color-profile for the imgproxy documentation
pb().stripColorProfile();
Strips the metadata from the image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#strip-metadata for the imgproxy documentation
pb().stripMetadata();
Prepend a <style>
node with the provided CSS styles to the
<svg>
node of a source SVG image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#style-idstyle for the imgproxy documentation
Rest
...options: [styles: StyleOptions]pb().style('fill:red;width:30px;');
pb().style({
fill: 'red';
width: '30px'
});
Trims the image background.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#trim for the imgproxy documentation
Rest
...options: [options: TrimOptions]pb().trim({
threshold: 10, // required
color: 'ffffff', // optional
equal: { // optional
horizontal: true, // optional
vertical: true // optional
}
});
Removes the specified modifier from the currently applied modifiers
The modifier
Allows redefining unsharpening options.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#unsharpening-idunsharpening for the imgproxy documentation
Rest
...options: [options: UnsharpeningOptions]pb().unsharpen({
mode: UnsharpeningMode.AUTO, // optional
weight: 11, // optional
dividor: 24 // optional
});
Redefines the second used for the thumbnail.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#video-thumbnail-second-idvideo-thumbnail-second for the imgproxy documentation
Rest
...options: [second: number]pb().videoThumbnailSecond(3);
Places a watermark on the processed image.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#watermark for the imgproxy documentation
Rest
...options: [options: WatermarkOptions]pb().watermark({
opacity: 0.8, // required
position: WatermarkPosition.REPLICATE // optional
scale: 2 // optional
});
pb().watermark({
opacity: 1.0,
scale: 1,
position: WatermarkPosition.WEST // optional
offset: { // optional
x: 10, // optional
y: 10 // optional
}
})
Adds a shadow to the watermark.
See https://github.com/imgproxy/imgproxy/blob/f95f57bb4df35c69ae2257958006ef54b1c1d8c7/docs/generating_the_url.md#watermark-shadow-idwatermark-shadow for the imgproxy documentation
Rest
...options: [sigma: number]pb().watermarkShadow(10);
Defines the desired width and height of the watermark. imgproxy always
uses fit
resizing type when resizing watermarks and enlarges them
when needed.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#watermark-size-idwatermark-size for the imgproxy documentation
Rest
...options: [options: WatermarkSizeOptions]pb().watermarkSize({
width: 30, // required
height: 30 // required
});
Generate an image from the provided text and use it as a watermark.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#watermark-text-idwatermark-text for the imgproxy documentation
Rest
...options: [text: string]pb().watermarkText("my watermark");
Use the image from the specified URL as a watermark.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#watermark-url-idwatermark-url for the imgproxy documentation
Rest
...options: [url: string]pb().watermarkUrl('https://example.com');
Multiply the image dimensions according to the specified factors.
See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#zoom for the imgproxy documentation
Rest
...options: [options: ZoomOptions]pb().zoom(3);
Generated using TypeDoc
The currently applied imgproxy modifiers