Create a Random Image Generator in Excel

by blockybears in Craft > Digital Graphics

2623 Views, 0 Favorites, 0 Comments

Create a Random Image Generator in Excel

banner.png

A random image generator created using excel
Make your own pixel style images like CryptoPunks or WierdWhales

Visit BlockyBears on opensea.io

Visit BlockyBears.com

Setting Up Excel

1.png
2.png
3.png
4.png
5.png

In excel mark out a grid for your drawing. Resize the rows & columns to be squares.
I made this 63 x 63 cells with the width and height set to 9 pixels.

Select the drawing area and the first column to the right. Go to conditional formatting and add a new rule.

Set the rule type to be:

Format only cells that contain

And set the rule to be:

Cell value – Equal to – 0

Set the fill colour and font colour to black

Repeat the steps for lots of colours increasing the cell value each time
1, 2, 3, 4, 5, 6, 7, …

Check the rules in the column to the right of the drawing area by typing the number in each cell.

Starting to Draw

6.png
7.png
8.png
9.png
10.png
  1. Start with a simple outline of the picture you want to work from.
    (I drew a bear)
  2. Import your picture into excel and position in the grid drawn earlier.
  3. Make the image slightly transparent so you can see the cells underneath.
  4. Follow the outline of your shape setting the cells to black by typing “1” in each cell
  5. Once the outline is complete split the outline up into sections that you want to edit individually
    I split my bear into:
    Ears
    Upper Head (Eyes)
    Lower Head (Mouth)
    Body
    Arms
    Feet

Add Dynamic Features

12.png
11.png
12a.png
legs.mkv
  1. In a new sheet copy just the part of the picture you want to work on.
  2. Copy and paste down the sheet to make different versions. Leave the first rows blank!
  3. Once you are happy with your designs we need to be able to pick which leg to use.
    Add a box where you can type which legs to pick.
  4. Inside the top cell (B2) of the drawing area add the formula to copy the leg design selected
    =INDIRECT(ADDRESS($AL$5*19+ROW(B2),COLUMN(B2)))
    
  5. Copy the formula across to the adjacent cells
  6. Test that the image changes as intended

Get Creative

14.png

Repeat the process for all other sections of your image creating each part of the picture on its own sheet within the workbook.

Make sure to update the row count in the formula for the actual height of the picture section you are drawing.

=INDIRECT(ADDRESS($AL$5*19+ROW(B2),COLUMN(B2)))

Link Everything Together

15.png
16.png
16a.png
  1. Go back to the original image created in the main drawing grid created at the start.
  2. Link each cell back to the changeable drawing on its part sheet.
  3. Repeat for all the drawing sections.
  4. Once your sheet is set-up you should have your full picture as selected by the individual parts.
  5. Go back to each individual sheet and set the selection for each part of drawing to be picked at random.
    =RANDBETWEEN(1,19)
    
  6. Change the value based on the number of drawings you have made.
    Here I have 19 different leg designs, so I need a random number between 1 and 19.
  7. Refresh the excel page to generate a new image each time.

Take It Further

final_6102cb7548202100fcdab686_866153.mp4
  • Experiment further with colours, backgrounds and features
  • Instead of defining static colours in the individual components, create random colour schemes for your drawings.
  • Set the rarity of different features and build this in to your random number selection.

Visit BlockyBears on opensea.io