Please bookmark this page to avoid losing your image tool!

Image Text Field Creator Studio

(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,
    text = "Текстовое поле",
    x = 50,
    y = 50,
    fontSize = 48,
    fontColor = "#FFFFFF",
    bgColor = "rgba(0, 0, 0, 0.6)",
    padding = 20,
    fontFamily = "sans-serif"
) {
    // Create canvas
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

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

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

    // Type casting to ensure parameters behave correctly
    x = Number(x);
    y = Number(y);
    fontSize = Number(fontSize);
    padding = Number(padding);
    text = String(text);

    // Parse multiline text (supporting both actual line breaks and escaped \n)
    const lines = text.split(/\\n|\n/);
    
    // Configure text styling
    ctx.font = `${fontSize}px ${fontFamily}`;
    ctx.textBaseline = 'top';

    // Calculate bounding box dimensions for the text field
    let maxWidth = 0;
    const lineHeight = fontSize * 1.2;
    const totalHeight = lines.length * lineHeight;

    for (let i = 0; i < lines.length; i++) {
        const metrics = ctx.measureText(lines[i]);
        if (metrics.width > maxWidth) {
            maxWidth = metrics.width;
        }
    }

    // Draw the background "text field" box if configured
    if (bgColor && bgColor !== 'transparent') {
        ctx.fillStyle = bgColor;
        
        const rectX = x - padding;
        const rectY = y - padding;
        const rectW = maxWidth + padding * 2;
        const rectH = totalHeight + padding * 2;
        
        // Draw a rounded rectangle for a more polished "studio" feel
        const radius = Math.min(12, rectW / 2, rectH / 2);
        
        ctx.beginPath();
        ctx.moveTo(rectX + radius, rectY);
        ctx.lineTo(rectX + rectW - radius, rectY);
        ctx.quadraticCurveTo(rectX + rectW, rectY, rectX + rectW, rectY + radius);
        ctx.lineTo(rectX + rectW, rectY + rectH - radius);
        ctx.quadraticCurveTo(rectX + rectW, rectY + rectH, rectX + rectW - radius, rectY + rectH);
        ctx.lineTo(rectX + radius, rectY + rectH);
        ctx.quadraticCurveTo(rectX, rectY + rectH, rectX, rectY + rectH - radius);
        ctx.lineTo(rectX, rectY + radius);
        ctx.quadraticCurveTo(rectX, rectY, rectX + radius, rectY);
        ctx.closePath();
        ctx.fill();
    }

    // Draw the actual text overlay
    ctx.fillStyle = fontColor;
    for (let i = 0; i < lines.length; i++) {
        const lineY = y + i * lineHeight;
        ctx.fillText(lines[i], x, lineY);
    }

    // Return the resulting canvas
    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 Text Field Creator Studio is a tool designed to overlay styled text fields onto images. It allows users to add custom text with specific positioning, font sizes, colors, and font families, while also providing a customizable semi-transparent background box to ensure text readability. This tool is useful for creating captioned photos, designing social media graphics, adding labels to images, or generating quick visual annotations for presentations and tutorials.

Leave a Reply

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

Other Image Tools:

Image Project Creation Icon and Text Field Tool

Image Text Underneath Adder

Image Language Editor

AI Image Project Creator Tool

Image Language Scanner Identifier

Image Scanner Identifier and Language Translator

Movie Studio Name and Year Image Scanner Identifier

Image Based Audio Song Lyric Identifier and MP3 Downloader

Image Scanner Interface Address Identifier Tool

3D Printer Scanner Identifier Tool

3D Model Printer and Scanner Identifier Tool

Image Scanner City Identifier Tool

Image Scanner Movie Identifier Tool

Scanner Identifier for Studio Company and Year from Image

Image Scanner Language Identifier and Dub Translator Tool

Image Scanner Software and Mediateka Topic Search Identifier

Image Scanner Identifier and Mediateka Search Topic Picker

Image Scanner Identifier Picker

Mediateka Image Scanner and Identifier Tool

Image Based Movie Scanner and Identifier

Image Address Icon Generator Tool

Image Company Year Identifier Scanner Tool

AI Company Year Generator From Image

Movie Studio Of The Year Photo Remover

AI Studio Company Year Image Identifier Generator

Image Search For Film Studio Finders

Image Scanner Topic Search Tool for Movie Studios and Companies

Image Search Topic Identifier For Movie Studios Of The Year

Movie Studio and Film Production ID Converter

Movie Project Details Generator with Studio and Year Information

Movie Studio Year ID Scanner and Converter Tool

Company of the Year Studio Project Converter

Image Description Tool

Image Converter

Image URL To Web Address Converter

Website Address To Favicon Icon Converter

See All →