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

Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Jianfei Guo 683 Jan 04, 2023
Design custom QR codes with this web app!

My-QR.Art This web app lets users design their own QR codes to any domain. It can be acessed on my-qr.art. You can find some more background info abou

Marien Raat 406 Dec 20, 2022
Maze generator with most popular shapes - hexagon, triangle, square

Maze-Generator Maze generator with most popular shapes - hexagon, triangle, square (sqaure not implemented yet): Theory: Planar Graph https://en.wikip

Kacper Plesiak 2 Dec 28, 2021
This is a python project which detects color of an image when you double click on it.

This is a python project which detects color of an image when you double click on it. You have to press ESC button to close the pop-up Image window. There are mainly two library CV2 and Pandas that a

Yashwant Kumar Singh 0 Aug 16, 2022
Docbarcodes extracts 1D and 2D barcodes from scanned PDF documents or images. It can be used to automate extraction and processing of all kind of documents.

Intro Barcodes are being used in many documents or forms to enable machine reading capabilities and reduce manual processing effort. Simple 1D barcode

Arlind Nocaj 3 Jun 18, 2022
Magic-Square - Creates a magic square by randomly generating a list until the list happens to be a magic square

Magic-Square Creates a magic square by randomly generating a list until the list happens to be a magic square. Done as simply as possible... Frequentl

Nick 2 Jan 01, 2022
Simple AI app that is guessing color of apple in picture

Apple Color Determinant Application that is guessing color of apple from image Install Pillow, sklearn and numpy, using command for your package manag

Gleb Nikitin 1 Oct 25, 2021
Python wrappers for external BART computational imaging tools and internal libraries

bartpy Python bindings for BART. Overview This repo contains code to generate an updated Python wrapper for the Berkeley Advance Reconstruction Toolbo

Max Litster 7 May 09, 2022
An open source image editor which can manipulate an image in many ways!

Image Editor - An open source image editor which can manipulate an image in many ways! If you need any more modes in repo or I

TroJanzHEX 44 Nov 17, 2022
An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents

Mylar Note that feature development has stopped as we have moved to Mylar3. EOL for this project is the end of 2020 and will no longer be supported. T

979 Dec 13, 2022
Image Processing HighPass Filter With Python

Image_Processing_HighPassFilter High Pass Filter take the high frequency and ignore the low frequency High Pass Filter can be use to sharpening an ima

Felix Pratamasan 1 Dec 27, 2021
An API that renders HTML/CSS content to PNG using Chromium

html_png An API that renders HTML/CSS content to PNG using Chromium Disclaimer I am not responsible if you happen to make your own instance of this AP

10 Aug 08, 2022
image-processing exercises.

image_processing Assignment 21 Checkered Board Create a chess table using numpy and opencv. view: Color Correction Reverse black and white colors with

Benyamin Zojaji 25 Dec 15, 2022
Python Digital Art Generator

Python Digital Art Generator The main goal of this repository is to generate all possible layers permutations given by the user in order to get unique

David Cuentas Mar 3 Mar 12, 2022
Gbs-image-colorizer - A tool to convert colorful pictures to GB Studio-compatible colorized backgrounds.

GB Studio Image Colorizer A tool to convert colorful pictures to GB Studio-compatible colorized backgrounds. Made by NalaFala/Yousurname/Y0UR-U5ERNAME

Yousurname 8 Dec 08, 2022
Scramb.py is a region based JPEG Image Scrambler and Descrambler written in Python

Scramb.py Scramb.py is a region based JPEG Image Scrambler and Descrambler written in Python. Main features Scramb.py can scramble images regions. So

47 Dec 25, 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
Script for the creation of metadatas and the randomization of images of MekaVerse

MekaVerse-random Script for the creation of metadata and the randomization of images of MekaVerse Step to replay the random : Create a folder : output

Miinded 8 Sep 07, 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
Extracts random colours from an image

EXTRACT COLOURS This repo contains all the project files. Project Description A Program that extracts 10 random colours from an image and saves the rg

David .K. Danso 3 Dec 13, 2021