@@ -19,19 +19,19 @@ https://libvips.github.io/pyvips/
19
19
20
20
This module wraps the libvips image processing library:
21
21
22
- https://libvips.github.io/ libvips/
22
+ https://www. libvips.org /
23
23
24
24
The libvips docs are also very useful:
25
25
26
- https://libvips.github.io/ libvips/API/current/
26
+ https://www. libvips.org /API/current/
27
27
28
28
If you have the development headers for libvips installed and have a working C
29
- compiler, this module will use cffi API mode to try to build a libvips
30
- binary extension for your Python.
29
+ compiler, this module will use cffi API mode to try to build a libvips
30
+ binary extension for your Python.
31
31
32
32
If it is unable to build a binary extension, it will use cffi ABI mode
33
33
instead and only needs the libvips shared library. This takes longer to
34
- start up and is typically ~20% slower in execution. You can find out if
34
+ start up and is typically ~20% slower in execution. You can find out if
35
35
API mode is being used with:
36
36
37
37
.. code-block :: python
@@ -41,7 +41,7 @@ API mode is being used with:
41
41
print (pyvips.API_mode )
42
42
43
43
This binding passes the vips test suite cleanly and with no leaks under
44
- python3 and pypy3 on Windows, macOS and Linux.
44
+ python3 and pypy3 on Windows, macOS and Linux.
45
45
46
46
How it works
47
47
------------
@@ -53,31 +53,45 @@ pipeline executes at once, streaming the image in parallel from source to
53
53
destination a section at a time.
54
54
55
55
Because ``pyvips `` is parallel, it's quick, and because it doesn't need to
56
- keep entire images in memory, it's light. For example, the libvips
56
+ keep entire images in memory, it's light. For example, the libvips
57
57
speed and memory use benchmark:
58
58
59
59
https://github.com/libvips/libvips/wiki/Speed-and-memory-use
60
60
61
61
Loads a large tiff image, shrinks by 10%, sharpens, and saves again. On this
62
62
test ``pyvips `` is typically 3x faster than ImageMagick and needs 5x less
63
- memory.
63
+ memory.
64
64
65
65
There's a handy chapter in the docs explaining how libvips opens files,
66
66
which gives some more background.
67
67
68
- http ://libvips.github.io/libvips/ API/current/How-it-opens-files.md .html
68
+ https ://www. libvips.org/ API/current/How-it-opens-files.html
69
69
70
- Install
71
- -------
70
+ Binary installation
71
+ -------------------
72
+
73
+ The quickest way to start with pyvips is by installing the binary package
74
+ with:
75
+
76
+ .. code-block :: shell
72
77
73
- You need the libvips shared library on your library search path,
74
- version 8.2 or later, though at least version 8.9 is required for all features
75
- to work. See:
78
+ $ pip install " pyvips[binary]"
76
79
77
- https://libvips.github.io/libvips/install.html
80
+ This installs a self-contained package with the most commonly needed
81
+ libraries. If your platform is unsupported or the pre-built binary is
82
+ unsuitable, you can install libvips globally instead.
78
83
79
- Linux install
80
- -------------
84
+ Local installation
85
+ ------------------
86
+
87
+ You need the libvips shared library on your library search path, version 8.2
88
+ or later, though at least version 8.9 is required for all features to work.
89
+ See:
90
+
91
+ https://www.libvips.org/install.html
92
+
93
+ Linux
94
+ ^^^^^
81
95
82
96
Perhaps:
83
97
@@ -94,22 +108,22 @@ With python 3.11 and later, you will need to create a venv first and add
94
108
$ python3 -m venv ~ /.local
95
109
$ pip install pyvips
96
110
97
- macOS install
98
- -------------
111
+ macOS
112
+ ^^^^^
99
113
100
- With homebrew :
114
+ With Homebrew :
101
115
102
116
.. code-block :: shell
103
117
104
118
$ brew install vips python pkg-config
105
119
$ pip3 install pyvips
106
120
107
- Windows install
108
- ---------------
121
+ Windows
122
+ ^^^^^^^
109
123
110
- on Windows you can download a pre-compiled binary from the libvips website.
124
+ On Windows, you can download a pre-compiled binary from the libvips website.
111
125
112
- https://libvips.github.io/ libvips/install.html
126
+ https://www. libvips.org /install.html
113
127
114
128
You'll need a 64-bit Python. The official one works well.
115
129
@@ -123,15 +137,15 @@ start of your program:
123
137
.. code-block :: python
124
138
125
139
import os
126
- vipsbin = r ' c:\v ips-dev-8. 13 \b in'
140
+ vipsbin = r ' c:\v ips-dev-8. 16 \b in'
127
141
os.environ[' PATH' ] = vipsbin + ' ;' + os.environ[' PATH' ]
128
142
129
143
For Python 3.8 and later, you need:
130
144
131
145
.. code-block :: python
132
146
133
147
import os
134
- vipsbin = r ' c:\v ips-dev-8. 13 \b in'
148
+ vipsbin = r ' c:\v ips-dev-8. 16 \b in'
135
149
add_dll_dir = getattr (os, ' add_dll_directory' , None )
136
150
if callable (add_dll_dir):
137
151
add_dll_dir(vipsbin)
@@ -140,10 +154,10 @@ For Python 3.8 and later, you need:
140
154
141
155
Now when you import pyvips, it should be able to find the DLLs.
142
156
143
- conda install
144
- -------------
157
+ Conda
158
+ ^^^^^
145
159
146
- The conda package includes a matching libvips binary, so just enter:
160
+ The Conda package includes a matching libvips binary, so just enter:
147
161
148
162
.. code-block :: shell
149
163
@@ -184,7 +198,7 @@ Run all tests:
184
198
185
199
.. code-block :: shell
186
200
187
- $ tox
201
+ $ tox
188
202
189
203
Run test suite:
190
204
237
251
.. code-block :: shell
238
252
239
253
$ cd doc; \
240
- python3 -c " import pyvips; pyvips.Operation.generate_sphinx_all()" > x
254
+ python3 -c " import pyvips; pyvips.Operation.generate_sphinx_all()" > x
241
255
242
- And copy-paste ``x `` into the obvious place in ``doc/vimage.rst ``.
256
+ And copy-paste ``x `` into the obvious place in ``doc/vimage.rst ``.
243
257
244
258
Update version number:
245
259
@@ -256,4 +270,3 @@ Update pypi package:
256
270
$ twine upload --repository pyvips dist/*
257
271
$ git tag -a v2.2.0 -m " as uploaded to pypi"
258
272
$ git push origin v2.2.0
259
-
0 commit comments