articon is a Python package for flexible, corpus-based icon mosaicking. Given a target image or video, articon tries to find the best matches from the corpus and assembled them into a mosaic. Here are some emoji-art examples made with articon.
To see a demo of video mosaics, click here
from articon.models import IconCorpus, IconMosaic
source = 'path/to/icon/images/folder/'
target = 'path/to/target/image/'
# create corpus, resizing all images to fit within 40x40 pixels
corpus = IconCorpus.read(source=source, size=40)
# visualize corpus
corpus.show()
# create mosaic, pre-resizing target to fit within 900x900 pixels
mosaic = IconMosaic(target=target,
corpus=corpus,
size=900)
# show mosaic
mosaic.show()
# write mosaic to disk
mosaic.save('mymosaic.png')
This code is a Python porting and expansion of emoji-mosaic by ericandrewlewis, and inspired by Yung Jake's emoji art.
To install the latest version of articon with pip, run:
pip install articon
A convenient corpus dataset that works well with articon is Kaggle's Full Emoji Image Dataset, which you can download here.
ISC License Copyright (c) 2023, Felipe Tovar-Henao
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.