Skip to main content

Convert any image to image that conforms with hexagon stickers standard.

Project description

hexsticker
----------

Produce hexagon stickers automatically from an image in compliance with the `Stickers Standard <https://sticker.how/>`_.


Installation
============

.. code-block:: console

$ pip install hexsticker


After the installation step listed above, you will be able to use the `hexsticker` command:

.. code-block:: console

$ hexsticker --help


Requirements
============

* Python 3.6+


Examples
========

Let's create a hexagon sticker for the `Selinon project <https://github.com/selinon>`_.

Here is the input image:

.. figure:: https://raw.githubusercontent.com/fridex/hexsticker/master/fig/input/selinon.png
:alt: Selinon input logo
:align: center

Let's create a hexagon sticker:

.. code-block:: console

$ hexsticker selinon.png -o selinon-sticker-1.png
INFO:hexsticker.create:Writing output to 'selinon-sticker-1.png'


The resulting image is:

.. figure:: https://raw.githubusercontent.com/fridex/hexsticker/master/fig/output/selinon-sticker-1.png
:alt: Selinon hexagon sticker sticker 1
:align: center
:scale: 50%

As can be seen above, there are some parts cut off - let's add some padding to the image:

.. code-block:: console

$ hexsticker input/selinon.png -o output/selinon-sticker-2.png --padding-size 25
INFO:hexsticker.create:Writing output to 'selinon-sticker-2.png'


.. figure:: https://raw.githubusercontent.com/fridex/hexsticker/master/fig/output/selinon-sticker-2.png
:alt: Selinon hexagon sticker sticker 2
:align: center
:scale: 50%


The padded part is white by default - that's why there are missing spikes of hexagon. Let's set color of padded area to the same color as background color of the original image:

.. code-block:: console

$ hexsticker input/selinon.png -o output/selinon-sticker-3.png --padding-size 25 --padding-color '#66cfa7'
INFO:hexsticker.create:Writing output to 'selinon-sticker-3.png'

.. figure:: https://raw.githubusercontent.com/fridex/hexsticker/master/fig/output/selinon-sticker-3.png
:alt: Selinon hexagon sticker sticker 3
:align: center
:scale: 50%


Nice! What we could do next? Let's try to add a hexagon border:

.. code-block:: console

$ hexsticker input/selinon.png -o output/selinon-sticker-4.png --padding-size 25 --padding-color '#66cfa7' --border-size 35
INFO:hexsticker.create:Writing output to 'selinon-sticker-4.png'


.. figure:: https://raw.githubusercontent.com/fridex/hexsticker/master/fig/output/selinon-sticker-4.png
:alt: Selinon hexagon sticker sticker 4
:align: center
:scale: 50%

Ehm, the default black one does not look that good in this case. Let's try some color that fits color scheme:

.. code-block:: console

$ hexsticker input/selinon.png -o output/selinon-sticker-5.png --padding-size 25 --padding-color '#66cfa7' --border-size 35 --border-color '#197a9f'
INFO:hexsticker.create:Writing output to 'selinon-sticker-5.png'


.. figure:: https://raw.githubusercontent.com/fridex/hexsticker/master/fig/output/selinon-sticker-5.png
:alt: Selinon hexagon sticker sticker 5
:align: center
:scale: 50%

As you can see, this tool can automate creation of hexagon stickers so they respect the hexagon standard. Feel free to additionally adjust the resulting image of your logo or the input image.

This tool supports only raster graphics.

Running from repo
=================

To run hexsticker from repository run the following commands:

.. code-block:: console

$ git clone https://github.com/fridex/hexsticker # or use ssh
$ cd hexsticker
$ pip3 install -r requirements.txt --user
$ export PYTHONPATH='.'
$ ./hexsticker-cli --help



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

hexsticker-1.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

hexsticker-1.1.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file hexsticker-1.1.0.tar.gz.

File metadata

  • Download URL: hexsticker-1.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for hexsticker-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3173b1dc63576c577959929541c608f06ae633a9a73c3e0b4cf012744a885f60
MD5 15e69653a79e039c4cc58d03ed9ae487
BLAKE2b-256 2a32519efcae3b981124a2906d5ccb1ddc56cd8d27b5f6a8326880afa0562ad5

See more details on using hashes here.

File details

Details for the file hexsticker-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: hexsticker-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for hexsticker-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bd0d3118466191defc7e11beb64c176a1005bf0541741b7e6bb42902ec1aaa1
MD5 859dda6f676aa790528bf18de9cdd9d6
BLAKE2b-256 7e11edbecee017eb049ad61e2e746402b682a4b35bc5130d3fc510fd842fae97

See more details on using hashes here.

Supported by

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