Skip to content

Software to turn any image into artwork made out of dice and give information to help create it in real life

Notifications You must be signed in to change notification settings

Chantland/Dice_Me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dice_Me

Turns inputted pictures into a dice mosaic output using optional predefined inputs such as: cropping, number of dice (i.e. the dimensions used), color of dice, pip size, and pip color.

Before Dice After Dice

Setup

  1. Make sure that you have the required packages listed in requirements.txt. Use pip install -r requirements.txt if unsure.
  2. The only command required is Dice_Me.dicePic("image.png") with image.png replaced with your file name and path.
  3. However, this will only use the default values for everything. For use of optional inputs use the following as well as checking main.py for general examples for running:

Functions

Function Brief Description required inputs Optional inputs
dicePic Main class, initialize the object the run pic_div. Will run through the rest of the functions unless optionally specified. The only thing absolutely required to call. To intialize the object pic = Dice_Me.dicePic("image.png") is recommended image="image.png" ycrop=[min,max], xcrop=[min,max], inp_prompt=boolean
pic_div Calculates every permutation that the inputted picture may be subdivided by. Only useful to be called if the image inputted is changed and you need to rerun the permutation. Otherwise, this is called when dicePic is initialized
dice_alt Specify what dice dimensions (number of dice comprising the width and height) based on the permutations found in posDiceNum which is obtained through running the object initialization of dicePic or pic_div. Input one of the permutations via a 2 integer list/array or just pic.posDiceNum[int] yxdim=[ydim,xdim]
inp_Dice Creates the dice image via scikit-learn using the optional arguments of percentage in decimal of pip size relative to the dice size as well as a dictionary of the dice colors and pip colors. See main.py for a template of the dictionary perc_pip=float, dice_dict=dict
showIm Used to show the image (UTF-8 encoded image array required and is typically aquired by calling pic.img_Dice_Pic). Unless otherwise specified, it will automatically save the shown image via printIm image=[UTF-8 numpy array] print_img=boolean
printIm Saves the image to folder "Image-output". Each saved image will also say the x and y dice dimensions used to create it. If desired, you may have duplicate images be each unique and saved. Otherwise if the image output already exists, save over it file_dup=boolean

About

Software to turn any image into artwork made out of dice and give information to help create it in real life

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages