This repository was archived by the owner on Jun 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
56 lines (34 loc) · 1.72 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
= About =
Python Library to merge images together.
This library creates a single PNG image by layering multiple images on top of
each other. It uses Cairo and GDK-PixBuf for reading, merging and writing the
images.
This library was developed to provide a faster alternative to Python Image
Library when using TileCache (http://tilecache.org/) with the Tile merging
feature.
= Installation instructions =
Use the standard setuptools instruction:
python setup.py install
You will need cairo and gdk-pixbuf-2.0 development packages.
This package also provides the required files for building a Debian/Ubuntu
package.
= Usage with TileCache =
You will need a TileCache version that is able to use this module.
Such a version is available in the repository:
https://github.com/camptocamp/tilecache
This TileCache version will automatically use this module if it is available
in the Python path. You don't need to configure anything.
= Usage with Python =
import image_merge
merged_image = image_merge.merge([image1, image2, ...], preserve_colors=False)
Where image1, image2, ..., imageN are strings with the PNG image bytes to be
merged together (image2 will be placed above image1 and so on).
If the preserve_colors keyword argument is True (defaults to False), do not
compose colors if the source and destination colors have the same rgba values.
The function returns a string containing the merged PNG image.
= Development notes =
Unit tests can be run using the tests.py script.
You can run Valgrind on the tests with the following command line:
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --log-file=valgrind.log --leak-check=full python tests.py
= Author =
Developed for Camptocamp SA, by Sylvain Pasche <[email protected]>