Please bookmark this page to avoid losing your image tool!

New Project Text Writer 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.
function processImage(originalImg, topicText = "New Project", byText = "Write Tools Text By", fontSize = 60, textColor = "#ffffff", verticalPosition = "center") {
    // Create a canvas element
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

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

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

    // Setup text styling for better visibility (white fill with black stroke)
    ctx.textAlign = "center";
    ctx.fillStyle = textColor;
    ctx.strokeStyle = "#000000"; // Black stroke to ensure readability on varying backgrounds
    ctx.lineJoin = "round";

    // Subtitle font size is smaller relative to main font size
    const subtitleFontSize = Math.max(16, fontSize * 0.5);

    // X coordinate is always centered
    const x = canvas.width / 2;

    // Determine starting Y coordinate based on verticalPosition
    let y;
    if (verticalPosition.toLowerCase() === "top") {
        y = fontSize + 20;
    } else if (verticalPosition.toLowerCase() === "bottom") {
        y = canvas.height - fontSize - subtitleFontSize - 30;
    } else {
        // Default to center
        y = (canvas.height / 2) - (fontSize / 2);
    }

    // Draw Main Topic Text
    ctx.font = `bold ${fontSize}px Arial, sans-serif`;
    ctx.lineWidth = Math.max(3, fontSize * 0.1);
    
    // Split the topic text into multiple lines if there are line breaks passed
    const topicLines = topicText.split('\\n');
    for (let i = 0; i < topicLines.length; i++) {
        ctx.strokeText(topicLines[i], x, y);
        ctx.fillText(topicLines[i], x, y);
        y += fontSize;
    }

    // Add extra padding before subtitle
    y += 10;

    // Draw Subtitle / By Text
    ctx.font = `normal ${subtitleFontSize}px Arial, sans-serif`;
    ctx.lineWidth = Math.max(2, subtitleFontSize * 0.1);
    
    const byLines = byText.split('\\n');
    for (let i = 0; i < byLines.length; i++) {
        ctx.strokeText(byLines[i], x, y);
        ctx.fillText(byLines[i], x, y);
        y += subtitleFontSize * 1.2;
    }

    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

This tool adds customizable text overlays to images. You can set a main heading and a subtitle, adjust font size, text color, and vertical position on the image. It is useful for creating project title cards, social media graphics, promotional banners, or adding captions to photos.

Leave a Reply

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