Radial Gradient Image Generator

by mst8k in Craft > Digital Graphics

140 Views, 3 Favorites, 0 Comments

Radial Gradient Image Generator

Screenshot 2024-06-12 000806.png

Create beautiful, custom radial gradient images with your own color palettes, perfect for high-resolution graphics and backgrounds for hourly and annual clock faces. This step-by-step guide will walk you through the process of generating these images using Python, with options for adding cutout guides for easy post-production.


Follow along to create your own vibrant and artistic prints, or download pre-generated samples below!

Supplies

Free Software and Libraries


  • Python 3.6+
  • NumPy
  • Matplotlib
  • Pillow


Script



Hardware (Optional)


  • Printer for printing your generated images
  • Scissors and/or a craft knife for cutting out the circular images

Install Python and Required Libraries

  1. Download and install Python from the official website: python.org.
  2. Install the required libraries by running the following commands in your terminal or command prompt:


pip install numpy matplotlib pillow

Download the Repository

  1. Download the latest script and samples images from GitHub https://github.com/MST8K-code/Radial-Gradient-O-Matic/releases
  2. Expand the compressed file into a new folder and then edit and run the script as desired.


Update Color Palettes

Open the Radial-Gradient-O-Matic.py script in a text editor and update the color_palettes dictionary to define your custom color palettes. Set the export field to True for the palettes you want to export.

By default the colors are distributed evenly around the circle. If you would like to do a custom gradient, add the degree value to each color. See the example below for the google_brand gradient. 0 degrees is at the 12-o'clock position in your graphic.


color_palettes = {
    'bright_rainbow': {
        'description': 'A bright and vibrant set of rainbow colors',
        'export': True,
        'colors': [
            {'name': 'Yellow', 'color': '#eedd00'},
            {'name': 'Orange', 'color': '#ee9944'},
            {'name': 'Pink', 'color': '#c53f65'},
            {'name': 'Lavender', 'color': '#8346c1'},
            {'name': 'Blue', 'color': '#3366bb'},
            {'name': 'Sky Blue', 'color': '#0099cc'},
            {'name': 'Cyan', 'color': '#22ccbb'},
            {'name': 'Green', 'color': '#99dd55'}
        ]
    },
    'google_brand': {
        'description': 'Google brand colors',
        'export': True,
        'colors': [
            {'name': 'Yellow', 'color': '#FBBC05', 'degree': 0},
            {'name': 'Red', 'color': '#EA4335', 'degree': 180},
            {'name': 'Blue', 'color': '#4285F4', 'degree': 270},
            {'name': 'Green', 'color': '#34A853', 'degree': 315}
        ]
    }
}

Adjust Script Constants

Customize the constants in the script to fit your needs. This includes the image resolution, print size, cutout ring properties, and more.


Example Constants

# Image Constants
outputSize = 6000  # Resolution in pixels
numSubdivisions = 30  # Number of divisions between each color change
gaussianBlurRadius = 50  # Radius for Gaussian blur


# Print Constants
printSize = 8  # Export print size in inches
printResolution = 350  # Resolution in DPI
cutoutThickness = 7  # Thickness of the cutout ring in pixels
cutoutColor = (0, 0, 0)  # Color of the cutout ring
inner_cutout_width_in = 0.25  # Inner cutout diameter in inches

Run the Script

Execute the script to generate the images and settings files. The files will be saved in the same directory with timestamped filenames.


python generate_radial_gradient.py

Print and Cut Out Your Images

  1. Print the images using a high-resolution printer.
  2. Cut out the circular images using scissors or a craft knife along the outer cutout ring. Use the inner cutout ring as a guide if needed.

Download - Smooth Gradations

Radial Gradient - Smooth - Seasons 1.png
Radial Gradient - Smooth - Seasons 2.png
Radial Gradient - Smooth - Seasons 3.png
Radial Gradient - Smooth - Seasons 4.png
Radial Gradient - Smooth - Seasons 5.png
Radial Gradient - Smooth - Bright Rainbow.png
Radial Gradient - Smooth - Google Brand Colors.png
Radial Gradient - Smooth - Cool Bright.png
Radial Gradient - Smooth - Dizzy Care Network 1.png
Radial Gradient - Smooth - Dizzy Care Network 2.png
Radial Gradient - Smooth - Dizzy Care Network 3.png
Radial Gradient - Smooth - Purple And Blue.png

Settings

  • Segments: 30
  • Gaussian: 50

Download - Weekly Segments (52)

Radial Gradient - Weekly - Seasons 1.png
Radial Gradient - Weekly - Seasons 2.png
Radial Gradient - Weekly - Seasons 3.png
Radial Gradient - Weekly - Seasons 4.png
Radial Gradient - Weekly - Google Brand Colors.png
Radial Gradient - Weekly - Dizzy Care Network 1.png
Radial Gradient - Weekly - Dizzy Care Network 3.png
Radial Gradient - Weekly - Purple And Blue.png

Download - Monthly Segments (12)

Radial Gradient - Monthly - Seasons 1.png
Radial Gradient - Monthly - Seasons 2.png
Radial Gradient - Monthly - Seasons 3.png
Radial Gradient - Monthly - Seasons 4.png
Radial Gradient - Monthly - Seasons 5.png
Radial Gradient - Monthly - Google Brand Colors.png
Radial Gradient - Monthly - Dizzy Care Network 1.png
Radial Gradient - Monthly - Dizzy Care Network 2.png
Radial Gradient - Monthly - Dizzy Care Network 3.png
Radial Gradient - Monthly - Purple And Blue.png

Download - Bi-Quarterly Segments (8)

Radial Gradient - Bi-Quarterly - Seasons 1.png
Radial Gradient - Bi-Quarterly - Seasons 2.png
Radial Gradient - Bi-Quarterly - Seasons 3.png
Radial Gradient - Bi-Quarterly - Seasons 4.png
Radial Gradient - Bi-Quarterly - Bright Rainbow.png
Radial Gradient - Bi-Quarterly - Google Brand Colors.png
Radial Gradient - Bi-Quarterly - Dizzy Care Network 1.png
Radial Gradient - Bi-Quarterly - Dizzy Care Network 3.png
Radial Gradient - Bi-Quarterly - Purple And Blue.png

Download - Bi-Monthly Segments (6)

Radial Gradient - Bi-Monthly - Seasons 5.png
Radial Gradient - Bi-Monthly - Dizzy Care Network 2.png
Radial Gradient - Bi-Monthly - Dizzy Care Network 3.png
Radial Gradient - Bi-Monthly - Purple And Blue.png

Download - Quarterly Segments (4)

Radial Gradient - Quarterly - Seasons 1.png
Radial Gradient - Quarterly - Seasons 2.png
Radial Gradient - Quarterly - Seasons 3.png
Radial Gradient - Quarterly - Seasons 4.png
Radial Gradient - Quarterly - Google Brand Colors.png
Radial Gradient - Quarterly - Dizzy Care Network 1.png
Radial Gradient - Quarterly - Dizzy Care Network 3.png
Radial Gradient - Quarterly - Purple And Blue.png