Please bookmark this page to avoid losing your image tool!

Sunflowered Image Effect Generator

(Free & Supports Bulk Upload)

Drag & drop your images here or

The result will appear here...
You can edit the below JavaScript code to customize the image tool.
function processImage(originalImg, pointCount = 20000, dotRadius = 3, backgroundColor = "#000000", sizeMode = "brightness") {
    // Determine dimensions
    const width = originalImg.width;
    const height = originalImg.height;

    // Parse parameters
    const points = parseInt(pointCount, 10) || 20000;
    const baseRadius = parseFloat(dotRadius) || 3;
    const mode = String(sizeMode).toLowerCase();

    // Create an off-screen canvas to extract image pixel data
    const srcCanvas = document.createElement('canvas');
    srcCanvas.width = width;
    srcCanvas.height = height;
    const srcCtx = srcCanvas.getContext('2d', { willReadFrequently: true });
    
    // Draw original image on the source canvas
    srcCtx.drawImage(originalImg, 0, 0);
    const imgData = srcCtx.getImageData(0, 0, width, height).data;

    // Create destination canvas for the effect
    const dstCanvas = document.createElement('canvas');
    dstCanvas.width = width;
    dstCanvas.height = height;
    const dstCtx = dstCanvas.getContext('2d');

    // Fill the background
    dstCtx.fillStyle = backgroundColor;
    dstCtx.fillRect(0, 0, width, height);

    // Sunflower mathematical constants (Fermat's Spiral / Golden Ratio)
    const cx = width / 2;
    const cy = height / 2;
    // Max radius needs to reach the corners
    const maxR = Math.sqrt(cx * cx + cy * cy); 
    const c = maxR / Math.sqrt(points);
    const goldenAngle = 137.507764 * (Math.PI / 180);

    // Generate the sunflower seeds arrangement
    for (let i = 1; i <= points; i++) {
        // Calculate polar coordinates
        const angle = i * goldenAngle;
        const r = c * Math.sqrt(i);

        // Convert to cartesian coordinates Let's center it in the middle of canvas
        const x = cx + r * Math.cos(angle);
        const y = cy + r * Math.sin(angle);

        // Only draw if the seed falls within the canvas boundaries
        if (x >= 0 && x < width && y >= 0 && y < height) {
            const px = Math.floor(x);
            const py = Math.floor(y);
            const idx = (py * width + px) * 4;

            // Extract RGBA colors from original image
            const red = imgData[idx];
            const green = imgData[idx + 1];
            const blue = imgData[idx + 2];
            const alpha = imgData[idx + 3] / 255;

            // Determine seed size based on mode
            let drawRadius = baseRadius;
            if (mode === 'brightness') {
                // Calculate perceived luminance
                const luma = (0.299 * red + 0.587 * green + 0.114 * blue) / 255;
                // Scale the dot radius based on brightness (brighter = larger seed)
                drawRadius = baseRadius * (0.2 + 1.2 * luma); 
            }

            // Draw the individual sunflower "seed"
            if (drawRadius > 0 && alpha > 0) {
                dstCtx.beginPath();
                dstCtx.arc(x, y, drawRadius, 0, 2 * Math.PI);
                dstCtx.fillStyle = `rgba(${red}, ${green}, ${blue}, ${alpha})`;
                dstCtx.fill();
            }
        }
    }

    return dstCanvas;
}

Free Image Tool Creator

Can't find the image tool you're looking for?
Create one based on your own needs now!

Description

The Sunflowered Image Effect Generator transforms standard photographs into artistic compositions using a mathematical sunflower seed pattern based on Fermat’s Spiral and the Golden Ratio. By distributing colored dots according to these geometric principles, the tool recreates the original image through a unique pointillist style. Users can customize the density of the pattern, the size of the dots, the background color, and use brightness-based scaling to adjust how the image details are represented. This tool is ideal for creating stylized digital art, unique social media profile pictures, or decorative patterns for graphic design projects.

Leave a Reply

Your email address will not be published. Required fields are marked *

Other Image Tools:

Doorbell Image Generator

Dewdrop Image Effect Generator

Image Crystal Drop Effect Applicator

Chess Image Generator

Cave Image Generator

Bongo Image Tool

Image Bongo Generator

Birdsong Image Generator

Image Bell Generator

Colorado Driver License Fictional Person Generator

Fake Driver License Image Generator

35mm 2960×1800 Ratio Resolution Image Resizer

The Lion King 1994 IMAX 70mm Movie Trailer Image

Big Hero 6 Character Replacement AI Tool for Video and Image

Big Hero 6 Character Replace AI Image and Video Tool

Big Hero 6 To Big Hero 6 The Series AU Replacement Tool

Big Hero 6 To Big Hero 6 The Series AU Image and Video Replacer

Slow Motion Video and Audio Playback Tool

Image Speed Reduction Tool

YouTube Stats For Nerds Audio Volume Normalization Analysis Tool

YouTube Stats For Nerds Audio Volume Normalization Information Tool

YouTube Stats For Nerds Volume Normalization Analyzer

YouTube Stats For Nerds Audio Volume Normalization Analyzer

YouTube Stats For Nerds Volume Normalization Analysis Tool

YouTube Stats For Nerds Audio Volume Normalization Information Display

YouTube Stats For Nerds Volume Normalization Information Tool

YouTube Stats For Nerds Audio Volume and Codec Information Extractor

YouTube Audio Stats Volume Normalization Tool for Mp2 Mp3 Opus and Ac3

Audio Volume Normalizer for Mp2 Mp3 Opus and Ac3 Formats

YouTube Audio Stats Volume Normalizer For Mp2 Mp3 Opus and Ac3 Formats

United States of America Federal Social Security Card Template Maker

Ukrainian Dub Master Video Voice Actor Information Tool

Ukrainian Dubbed Video Voice Actor Information Tool

YouTube Stats For Nerds Volume Normalizer for Opus and Ac3 Audio

YouTube Audio Volume Normalization Tool for Opus and Ac3 Formats

YouTube Stats For Nerds Volume Normalization Tool

See All →