Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/share/gtk-doc/html/libvips/ drwxr-xr-x | |
| Viewing file: Select action/file-type:
IntroductionUse the vips command to execute VIPS operations from the command-line. For example: $ vips rot k2.jpg x.jpg d90
Will rotate the image
$ vips rot
rotate an image
usage:
rot in out angle
where:
in - Input image, input VipsImage
out - Output image, output VipsImage
angle - Angle to rotate image, input VipsAngle
default: d90
allowed: d0, d90, d180, d270
There's a straightforward relationship with the C API: compare this to
the API docs for Listing all operationsYou can list all classes with:
$ vips -l
...
VipsOperation (operation), operations
VipsSystem (system), run an external command
VipsArithmetic (arithmetic), arithmetic operations
VipsBinary (binary), binary operations
VipsAdd (add), add two images
... etc.
Each line shows the canonical name of the class (for example
The API docs have a handy table of all vips operations, if you want to find out how to do something, try searching that. Optional argumentsMany operations take optional arguments. You can supply these as command-line options. For example:
$ vips gamma
gamma an image
usage:
gamma in out
where:
in - Input image, input VipsImage
out - Output image, output VipsImage
optional arguments:
exponent - Gamma factor, input gdouble
default: 2.4
min: 1e-06, max: 1000
operation flags: sequential-unbuffered
Use it from the command-line like this: $ vips gamma k2.jpg x.jpg --exponent 0.42
This will read file Array arguments
Some operations take arrays of values as arguments. For example,
$ vips affine k2.jpg x.jpg "2 0 0 1"
You may need the quotes to stop your shell breaking the argument at
the spaces. $ vips bandjoin "k2.jpg k4.jpg" x.tif
Implicit file format conversionvips will automatically convert between image file formats for you. Input images are detected by sniffing their first few bytes; output formats are set from the filename suffix. You can see a list of all the supported file formats with something like: $ vips -l foreign Then get a list of the options a format supports with: $ vips jpegsave
You can pass options to the implicit load and save operations enclosed in square brackets after the filename: vips affine k2.jpg x.jpg[Q=90,strip] "2 0 0 1"
Will write Chaining operationsBecause each operation runs in a separate process, you can't use libvips's chaining system to join operations together, you have to use intermediate files. The command-line interface is therefore quite a bit slower than Python or C. The best alternative is to use vips files for intermediates. Something like: vips invert input.jpg t1.v vips affine t1.v output.jpg "2 0 0 1" rm t1.v
Other featuresFinally, vips has a couple of useful extra options.
VIPS comes with a couple of other useful programs. vipsheader is a command which can print image header fields. vipsedit can change fields in vips format images. vipsthumbnail can make image thumbnails quickly. |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0083 ]-- |