Skip to main content

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

osaic-1.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

osaic-1.1.0-py2.6.egg (7.3 kB view details)

Uploaded Egg

osaic-1.1.0-py2.5.egg (7.3 kB view details)

Uploaded Egg

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

Hashes for osaic-1.1.0.tar.gz
Algorithm Hash digest
SHA256 43918414c9cdfd937549d93240ff702e7eea208464b526ffc48981cab863e6ff
MD5 52f16ad9b68cd3a8c6d7bf0ac3cf881f
BLAKE2b-256 3ead2638381c93e34a8e698562ee521bff614f5dac6d6203fdca20b79eeeb30f

See more details on using hashes here.

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

Hashes for osaic-1.1.0-py2.6.egg
Algorithm Hash digest
SHA256 b39c86f25fb66810f85f4ba3b9032c18c4f38090306c9bd0ec57ba7afe434bbe
MD5 260dec55267189dc98fb26d99b35f8f9
BLAKE2b-256 d6f2c438eb8e1a987d80e03cd1086b059361aee20d4dd6eb99e8e7326ccfb540

See more details on using hashes here.

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

Hashes for osaic-1.1.0-py2.5.egg
Algorithm Hash digest
SHA256 6369b0e2d59aa90cddfaa9d309ea7ce35d09859fefbfb6be467630c5b3c2b5ed
MD5 1748ca8e3a6cad10ec93a09d6d514385
BLAKE2b-256 957f1edd45425713619060b80bbd2aad983060b7d50a74cb83de401b22b3dcaf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page