Please bookmark this page to avoid losing your image tool!

Image Super Flower Creator

(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, petalsCount = "12", scaleImage = "1", shiftX = "0", shiftY = "0", rotateImage = "0", enableFlowerEdge = "1", bgColor = "transparent") {
    // Parse and sanitize parameters
    let visualPetals = Math.max(2, parseInt(petalsCount) || 12);
    let halves = visualPetals * 2; 

    let zoom = parseFloat(scaleImage) || 1;
    let offsetX = parseFloat(shiftX) || 0;
    let offsetY = parseFloat(shiftY) || 0;
    let rot = parseFloat(rotateImage) || 0;
    let isFlower = parseInt(enableFlowerEdge) !== 0;

    // Set up high-quality responsive canvas
    const canvas = document.createElement('canvas');
    const size = Math.max(originalImg.width, originalImg.height, 800);
    const cx = size / 2;
    const cy = size / 2;
    const radius = size * 0.48; // Leave a tiny margin
    
    canvas.width = size;
    canvas.height = size;
    const ctx = canvas.getContext('2d', { alpha: true });
    ctx.imageSmoothingQuality = "high";
    ctx.imageSmoothingEnabled = true;

    // Handle Background
    if (bgColor && bgColor !== "transparent") {
        ctx.fillStyle = bgColor;
        ctx.fillRect(0, 0, size, size);
    } else {
        ctx.clearRect(0, 0, size, size);
    }
    
    const sliceAngle = (Math.PI * 2) / halves;
    
    // Base scale ensures that the minimum image dimension completely fills out to the petal tip radius
    const minImgDim = Math.min(originalImg.width / 2, originalImg.height / 2);
    const baseScale = radius / minImgDim;
    const finalZoom = zoom * baseScale;

    // Draw passes (2 passes naturally fix 99% of transparent anti-aliasing clip seams)
    for (let pass = 0; pass < 2; pass++) {
        for (let i = 0; i < halves; i++) {
            ctx.save();
            ctx.translate(cx, cy);
            
            // Alternating reflections map everything cleanly without overlapping edges
            if (i % 2 === 0) {
                ctx.rotate(i * sliceAngle);
            } else {
                ctx.rotate((i + 1) * sliceAngle);
                ctx.scale(1, -1);
            }
            
            ctx.beginPath();
            ctx.moveTo(0, 0);
            
            if (isFlower) {
                // Creates a beautiful organic petal with a smooth V-cleft and a sharp pointed tip
                const rInner = radius * 0.6; // Cleft depth
                const rOuter = radius;       // Peak reach
                
                ctx.lineTo(rInner, 0);
                
                // Curve mathematically meets its mirror counterpart smoothly, simulating perfect flower logic
                const cpX = rOuter;
                const cpY = 0;
                const endX = rOuter * Math.cos(sliceAngle);
                const endY = rOuter * Math.sin(sliceAngle);
                
                ctx.quadraticCurveTo(cpX, cpY, endX, endY);
                ctx.lineTo(0, 0);
            } else {
                // Classic circle polygon wedge for ordinary spirograph/mandala appearance
                ctx.arc(0, 0, radius, 0, sliceAngle);
                ctx.lineTo(0, 0);
            }
            
            ctx.closePath();
            ctx.clip();
            
            // Apply translations inside the confined petal mask
            ctx.translate(offsetX, offsetY);
            ctx.rotate((rot * Math.PI) / 180);
            ctx.scale(finalZoom, finalZoom);
            
            // Draw perfectly centered to coordinate origin
            ctx.drawImage(originalImg, -originalImg.width / 2, -originalImg.height / 2);
            
            ctx.restore();
        }
    }
    
    return canvas;
}

Free Image Tool Creator

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

Description

The Image Super Flower Creator is an artistic tool that transforms your standard images into beautiful, symmetrical flower-shaped patterns or mandalas. By using mathematical reflections and petal-shaped masks, the tool duplicates and rotates your image to create organic, radial designs. Users can customize the output by adjusting the number of petals, scaling the image, rotating the pattern, and shifting the composition. It also offers options to enable or disable specific petal edges and change the background color. This tool is ideal for creating unique profile pictures, decorative digital art, social media assets, or custom patterns for graphic design projects.

Leave a Reply

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