Create mosaics from images with ``python -mosaic image``
Project description
osaic is a simple module which let you create mosaics from images with a simple python -mosaic foo.jpg command.
Dependencies
osaic depends on the PIL library which is going to be installed automatically by the installation script: anyway, in order to make it possible to edit jpeg and png images, please install libjpeg and libpng.
Install
From sources:
cd /path/to/workspace wget http://pypi.python.org/packages/source/o/osaic/osaic-1.0.0.tar.gz tar zxvf osaic-1.0.0.tar.gz cd osaic-1.0.0 python setup.py install
From the PyPI:
pip install osaic
Usage
osaic is a module that can be used either as a standalone application or as a standard python library.
Standalone application
A typical usage of the application is to display a mosaic composition created from a source image:
python -mosaic image.jpg
If you want to save the output to a file instead of showing it:
python -mosaic image.jpg -o mosaic-image.jpg
Finally, if you want to create a mosaic which is 4 times bigger than the original image, and with 100 tiles per axis, just issue:
python -mosaic -s4 -t100 image.jpg
For everything else use the help message:
python -mosaic -h
Library
First of all, import the module:
>>> import osaic
Then create a new Osaic object:
>>> mos = osaic.Osaic('foo.jpg', tiles=32, size=1, mode=osaic.DEFAULT)
At this point, create the mosaic, show it on screen and save it on a file:
>>> mos.create()
>>> mos.show()
>>> mos.save('bar.jpg')
Alternatively, you can use the create function shipped with the module which is a wrapper of all the actions listed above:
>>> import osaic >>> osaic.create( ... filename='foo.jpg', ... tiles=32, ... size=2, ... mode=osaic.DEFAULT, ... output=None, ... )
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osaic-1.1.0.tar.gz.
File metadata
- Download URL: osaic-1.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43918414c9cdfd937549d93240ff702e7eea208464b526ffc48981cab863e6ff
|
|
| MD5 |
52f16ad9b68cd3a8c6d7bf0ac3cf881f
|
|
| BLAKE2b-256 |
3ead2638381c93e34a8e698562ee521bff614f5dac6d6203fdca20b79eeeb30f
|
File details
Details for the file osaic-1.1.0-py2.6.egg.
File metadata
- Download URL: osaic-1.1.0-py2.6.egg
- Upload date:
- Size: 7.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b39c86f25fb66810f85f4ba3b9032c18c4f38090306c9bd0ec57ba7afe434bbe
|
|
| MD5 |
260dec55267189dc98fb26d99b35f8f9
|
|
| BLAKE2b-256 |
d6f2c438eb8e1a987d80e03cd1086b059361aee20d4dd6eb99e8e7326ccfb540
|
File details
Details for the file osaic-1.1.0-py2.5.egg.
File metadata
- Download URL: osaic-1.1.0-py2.5.egg
- Upload date:
- Size: 7.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6369b0e2d59aa90cddfaa9d309ea7ce35d09859fefbfb6be467630c5b3c2b5ed
|
|
| MD5 |
1748ca8e3a6cad10ec93a09d6d514385
|
|
| BLAKE2b-256 |
957f1edd45425713619060b80bbd2aad983060b7d50a74cb83de401b22b3dcaf
|