Please bookmark this page to avoid losing your image tool!

Image Rule Of Thirds Guide

(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.
/**
 * Overlays a "Rule of Thirds" grid on an image.
 *
 * @param {Image} originalImg The original javascript Image object.
 * @param {string} lineColor The color of the grid lines (e.g., 'white', '#FF0000', 'rgba(255, 0, 0, 0.5)'). Defaults to a semi-transparent white.
 * @param {number} lineWidth The width of the grid lines in pixels. Defaults to 2.
 * @returns {HTMLCanvasElement} A new canvas element with the original image and the grid drawn on it.
 */
function processImage(originalImg, lineColor = 'rgba(255, 255, 255, 0.7)', lineWidth = 2) {
    // Create a new canvas element
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

    // Get the dimensions from the original image
    const width = originalImg.naturalWidth;
    const height = originalImg.naturalHeight;

    // Set the canvas dimensions to match the image
    canvas.width = width;
    canvas.height = height;

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

    // Calculate the positions for the rule of thirds lines
    const oneThirdWidth = width / 3;
    const twoThirdsWidth = width * 2 / 3;
    const oneThirdHeight = height / 3;
    const twoThirdsHeight = height * 2 / 3;

    // Begin drawing the grid
    ctx.beginPath();

    // Set line style
    ctx.strokeStyle = lineColor;
    ctx.lineWidth = lineWidth;

    // Draw vertical lines
    ctx.moveTo(oneThirdWidth, 0);
    ctx.lineTo(oneThirdWidth, height);
    ctx.moveTo(twoThirdsWidth, 0);
    ctx.lineTo(twoThirdsWidth, height);

    // Draw horizontal lines
    ctx.moveTo(0, oneThirdHeight);
    ctx.lineTo(width, oneThirdHeight);
    ctx.moveTo(0, twoThirdsHeight);
    ctx.lineTo(width, twoThirdsHeight);

    // Render the lines
    ctx.stroke();

    // Return the 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 Rule of Thirds Guide overlays a grid based on the Rule of Thirds on an image, helping photographers and artists compose visually balanced and appealing images. This tool can be especially useful for evaluating the composition of photographs, planning shots, and enhancing visual storytelling by guiding the placement of key elements within the frame. Users can customize the grid line color and width to suit their preferences.

Leave a Reply

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