Please bookmark this page to avoid losing your image tool!

Image Diagonal Golden Ratio Overlay Tool

(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.
/**
 * Creates a "Dynamic Symmetry" grid overlay on an image. This is a diagonal-based
 * compositional guide related to the Golden Ratio, often called the Armature of the Rectangle.
 * The grid consists of the two main diagonals and perpendicular lines ("reciprocal lines")
 * drawn from each corner to the opposite diagonal. It's a powerful tool for creating
 * dynamic and balanced compositions.
 *
 * @param {HTMLImageElement} originalImg The original image object to process.
 * @param {string} [lineColor='rgba(255, 255, 0, 0.75)'] The color of the overlay lines.
 * @param {number} [lineWidth=2] The width of the overlay lines in pixels.
 * @returns {HTMLCanvasElement} A new canvas element with the original image and the overlay.
 */
function processImage(originalImg, lineColor = 'rgba(255, 255, 0, 0.75)', lineWidth = 2) {
    // 1. Create a canvas and get its 2D rendering context.
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

    // 2. Set the canvas dimensions to match the image.
    const W = originalImg.width;
    const H = originalImg.height;
    canvas.width = W;
    canvas.height = H;

    // 3. Draw the original image onto the canvas.
    ctx.drawImage(originalImg, 0, 0);

    // 4. Set the properties for the overlay lines.
    ctx.strokeStyle = lineColor;
    ctx.lineWidth = lineWidth;
    ctx.lineCap = 'round';

    // 5. Pre-calculate values used for finding intersection points.
    // This avoids recalculating these values repeatedly.
    const W2 = W * W;
    const H2 = H * H;
    const D = W2 + H2;

    // Avoid division by zero if the image has no area.
    if (D === 0) {
        return canvas;
    }

    // 6. Begin drawing the overlay path.
    ctx.beginPath();

    // --- Draw the two main diagonals ("Baroque" and "Sinister" diagonals) ---
    // Diagonal from top-left (0,0) to bottom-right (W,H)
    ctx.moveTo(0, 0);
    ctx.lineTo(W, H);
    // Diagonal from top-right (W,0) to bottom-left (0,H)
    ctx.moveTo(W, 0);
    ctx.lineTo(0, H);

    // --- Draw the four perpendicular "reciprocal" lines ---
    // These lines are drawn from a corner to intersect the opposite main diagonal at 90 degrees.

    // Perpendiculars to the diagonal from top-left -> bottom-right:
    // From corner (W, 0)
    const p1x = W * W2 / D;
    const p1y = W2 * H / D;
    ctx.moveTo(W, 0);
    ctx.lineTo(p1x, p1y);

    // From corner (0, H)
    const p2x = H2 * W / D;
    const p2y = H * H2 / D;
    ctx.moveTo(0, H);
    ctx.lineTo(p2x, p2y);

    // Perpendiculars to the diagonal from top-right -> bottom-left:
    // From corner (0, 0)
    const p3x = W * H2 / D;
    const p3y = W2 * H / D;
    ctx.moveTo(0, 0);
    ctx.lineTo(p3x, p3y);

    // From corner (W, H)
    const p4x = W * W2 / D;
    const p4y = H * H2 / D;
    ctx.moveTo(W, H);
    ctx.lineTo(p4x, p4y);

    // 7. Render all the lines on the canvas.
    ctx.stroke();

    // 8. Return the final canvas element.
    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 Diagonal Golden Ratio Overlay Tool allows users to enhance their images by adding a dynamic symmetry grid overlay based on the Golden Ratio. This tool provides a compositional guide that helps create balanced and visually appealing images. It features two main diagonals along with perpendicular lines that help in aligning elements within the image. This can be particularly useful for photographers, graphic designers, and artists looking to improve the composition of their work by following established principles of design.

Leave a Reply

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

Other Image Tools:

Image Line Drawer and Eraser

Image To Binary Converter For Optimized Storage

Image Japanese Anime Cell Shading Tool

Image Japanese Anime Cel Shading Renderer for Military Vehicles

Image Anime Cel Shade Effect Generator

Image Liquid Metallic Chrome Material Top View

Image Generator for Rainbow Six Siege Logo with Rainbow Fill

Image Transparency Adjuster for Clothing

Photo VHS Found Footage Analog Effect Tool

Image Old Fashioned Wanted Poster Creator

Image Toxic Waste Identifier

Image Realism Enhancer

Image Bulk Date and Location Stamp Adder Without Background Color

Image Time Stamp Removal Tool

Image Bulk Date and Text Stamp Adder

Image Bulk Date and Location Stamp Adder

Image Date and Location Stamp Adder

Image Date and Zone Stamping Tool

Image Bulk Date and Location Stamper

Image Bulk Date and Coordinate Stamper

Photo Artificial Metadata Generator

Photo Artificial Pattern Generator for Deepfake Bypass

Image Ultra Realistic Skin Texture Pore Emulation Tool

Image Chaotic Noise and Blur Generator for Deepfake Detection Evasion

Image Deep Effects Modification Tool

Image Portrait to Classic Hollywood Cinematic Still Enhancer

Image Chaotic Deep Modifications Editor

Image Chaotic Interleaving Modifier

Image Random Effects Generator with Low Intensity

Image Random Effects Generator

Image Chaotic Noise and Mosaic Effect Maker

Image Chaotic Noise Generator for Deepfake Detection Evasion

Image 4K Enhancement Tool for Realistic Skin Texture

Image Batch Chroma Key Processor

Image To Cel-Shaded Vector Converter

Image Hair Color Change Tool

See All →