Computer art based on joining transparent images

Overview

Computer Art

There is no must in art because art is free.

Introduction

The following tutorial exaplains how to generate computer art based on a series of predefined digital images. Our script will combinate all the digital images generating an specific image collection

Example Case

We will use the following digital assets:

  • 4 x backgrounds images
  • 12 x bodies images
  • 12 x faces images

Expected Results

Our script will generate 576 new images as a result of combinate 4 x 12 x 12 (backgrounds, bodies, and faces).

Example

Environment

The script was successfully tested with:

  • Python 3.8.5
  • Pip 21.2.4
  • Pillow 8.3.2

Digital Assets

There is an images folder with 3 sub-folders

  • /images/backgrounds
  • /images/bodies
  • /images/faces

Inside each sub-folder there is a few transparent png files named with 2-left pad zero strategy, for example: 01.png, 02.png, ..., 11.png

Script Strategy

1. Import Pillow Module

# importing the Pillow module
from PIL import Image, ImageDraw, ImageFilter

2. Define how many digital assets will combine

# my primary source :D
kBackgrounds = 4
kBodies = 12
kFaces = 12

3. Loop in order

for index_background in range(1, kBackgrounds + 1):
    for index_body in range(1, kBodies + 1):
        for index_face in range(1, kFaces + 1):

4. Load the 3 images that will generate the current new image

            im1 = Image.open(/path/to/index_background.png)
            im2 = Image.open(/path/to/index_body.png)
            im3 = Image.open(/path/to/index_face.png)

5. Paste img2 and img3 into img1 in the right position

Example

The magic happens because all the bodies and all the faces have the same canvas/size!

            # paste body into background
            im1.paste(im2, (540, 1970), mask=im2)
            # paste face into background
            im1.paste(im3, (456, 370), mask=im3)

6. Save & continue the loop with the next combination!

            # save!
            im1.save(/path/to/new-image.png)

            # update status!
            print(/path/to/new-image.png, "was successfully created.")

Bye!

Example

将位图转为彩色矢量 svg 图片

一个将位图描摹为彩色矢量 svg 图片的程序,是一个命令行工具,使用 Python 脚本实现,运行环境 Python3.8+。 ✨ 效果 以一个字帖图片为例,这是 png 格式的位图(370KB): 这是颜

Haujet Zhao 104 Dec 30, 2022
Image manipulation package used for EpicBot.

Image manipulation package used for EpicBot.

Nirlep_5252_ 7 May 26, 2022
Glyphtracer is an app for converting images of letters to a font

Glyphtracer takes an image that contains pictures of several letters. It recognizes all them and lets the user tag each letter to a Unicode code point. It then converts the images to vector form and

Jussi Pakkanen 38 Dec 24, 2022
Generates images of calendar month tables and can paste them onto suitable photos.

📆 calendizer README Generates images of calendar month tables and can paste them onto suitable photos. A quick way to make your own calendar for prin

Sean Ryan 2 Dec 14, 2022
An application that maps an image of a LaTeX math equation to LaTeX code.

Convert images of LaTex math equations into LaTex code.

1.3k Jan 06, 2023
Me cleaner - Tool for partial deblobbing of Intel ME/TXE firmware images

me_cleaner me_cleaner is a Python script able to modify an Intel ME firmware image with the final purpose of reducing its ability to interact with the

Nicola Corna 4.1k Jan 08, 2023
Photini - A free, easy to use, digital photograph metadata (Exif, IPTC, XMP) editing application for Linux, Windows and MacOS.

A free, easy to use, digital photograph metadata (Exif, IPTC, XMP) editing application for Linux, Windows and MacOS. "Metadata" is said to mea

Jim Easterbrook 120 Dec 20, 2022
A Python3 library to generate dynamic SVGs

The Python library for generating dynamic SVGs using Python3

1 Dec 23, 2021
QR fixer part is standalone but for image to FQR conversion

f-qr-fixer QR fixer part is standalone but for image to FQR conversion it requires Pillow (can be installed with easy_install), qrtools (on ubuntu the

2 Nov 22, 2022
Simple mathematical operations on image, point and surface layers.

napari-math This package provides a GUI interfrace for simple mathematical operations on image, point and surface layers. addition subtraction multipl

Zach Marin 2 Jan 18, 2022
Gaphor is the simple modeling tool

Gaphor Gaphor is a UML and SysML modeling application written in Python. It is designed to be easy to use, while still being powerful. Gaphor implemen

Gaphor 1.3k Dec 31, 2022
Validate arbitrary image uploads from incoming data urls while preserving file integrity but removing EXIF and unwanted artifacts and RCE exploit potential

Validate arbitrary base64-encoded image uploads as incoming data urls while preserving image integrity but removing EXIF and unwanted artifacts and mitigating RCE-exploit potential.

A3R0 1 Jan 10, 2022
vsketch is a Python generative art toolkit for plotters

Generative plotter art environment for Python

Antoine Beyeler 380 Dec 29, 2022
Create a 2D mesh for an airfoil in GMSH using python.

GMSHFoil A simple class to create a 2D mesh for an airfoil in GMSH using python. Requirements pip install airfoils

Charilaos Mylonas 1 May 16, 2022
Glyph-graph - A simple, yet versatile, package for graphing equations on a 2-dimensional text canvas

Glyth Graph Revision for 0.01 A simple, yet versatile, package for graphing equations on a 2-dimensional text canvas List of contents: Brief Introduct

Ivan 2 Oct 21, 2022
Fast Image Retrieval (FIRe) is an open source image retrieval project

Fast Image Retrieval (FIRe) is an open source image retrieval project release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This project implements most of the major bi

CISiP Lab 39 Nov 25, 2022
Bot by image recognition simulating (random) human clicks

bbbot22 bot por reconhecimento de imagem simulando cliques humanos (aleatórios) inb4: sim, esse é basicamente o mesmo bot de 2021 porque a Globo não t

Yuri 2 Apr 05, 2022
Water marker for images.

watermarker linux users: To fix this error,please add truetype font path File "watermark.py", line 58, in module font = ImageFont.truetype("Dro

13 Oct 27, 2022
Blender addon - convert empty image reference to image plane

Reference to image plane Convert reference images to a textured image mesh plane. As if it was imported with import image as plane Use on drag'n'dropp

Samuel Bernou 6 Nov 25, 2022
Image histogram remapping

Hmap An image histogram remapping script written in Python 2.7 by Anthony Kesich and Ross Goodwin. Changes source image so that source image's histogr

Ross Goodwin 199 Nov 19, 2022