Please bookmark this page to avoid losing your image tool!

Image Text Underneath Adder

(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 = "Под ней текст", 
    fontSize = 24, 
    fontFamily = "Arial, sans-serif", 
    textColor = "#000000", 
    bgColor = "#ffffff", 
    padding = 20
) {
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');
    
    // Convert inputs to numbers where appropriate
    const parsedFontSize = Number(fontSize) || 24;
    const parsedPadding = Number(padding) || 0;
    
    // Set initial canvas dimension for measuring text
    // Important to set font before measuring
    canvas.width = originalImg.width || 1;
    canvas.height = originalImg.height || 1;
    ctx.font = `${parsedFontSize}px ${fontFamily}`;
    
    const maxWidth = Math.max(originalImg.width - (parsedPadding * 2), parsedFontSize);
    const lineHeight = parsedFontSize * 1.2;
    
    // Handle literal string '\n' and actual new lines
    const paragraphs = String(text).replace(/\\n/g, '\n').split('\n');
    const lines = [];
    
    // Text wrapping logic
    for (let p = 0; p < paragraphs.length; p++) {
        const words = paragraphs[p].split(' ');
        let currentLine = words[0] || "";
        
        for (let i = 1; i < words.length; i++) {
            const word = words[i];
            const width = ctx.measureText(currentLine + " " + word).width;
            
            if (width < maxWidth) {
                currentLine += " " + word;
            } else {
                lines.push(currentLine);
                currentLine = word;
            }
        }
        lines.push(currentLine);
    }
    
    // Calculate final dimensions
    const textBlockHeight = lines.length * lineHeight;
    const bottomSectionHeight = textBlockHeight + (parsedPadding * 2);
    
    canvas.width = originalImg.width;
    canvas.height = originalImg.height + bottomSectionHeight;
    
    // Context is cleared/reset when canvas resizing, so we re-apply settings
    ctx.font = `${parsedFontSize}px ${fontFamily}`;
    ctx.textAlign = 'center';
    ctx.textBaseline = 'middle';
    
    // Draw original image
    ctx.drawImage(originalImg, 0, 0);
    
    // Draw background for the text area
    ctx.fillStyle = bgColor;
    ctx.fillRect(0, originalImg.height, canvas.width, bottomSectionHeight);
    
    // Draw text
    ctx.fillStyle = textColor;
    
    // Start Y coordinate for the first line of text
    const startY = originalImg.height + parsedPadding + (lineHeight / 2);
    
    for (let i = 0; i < lines.length; i++) {
        ctx.fillText(lines[i], canvas.width / 2, startY + (i * lineHeight));
    }
    
    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 Underneath Adder is a tool designed to append a customizable text area to the bottom of an image. Users can input custom text, adjust font size, select font families, and choose specific colors for both the text and the background area. The tool automatically handles text wrapping and expands the image height to accommodate the new content. This is useful for creating captioned photos, adding descriptions to product images, or generating memes and instructional graphics.

Leave a Reply

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

Other Image Tools:

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

Image To Web Interface Website Address Database Icon Converter

Television Icon Generator

See All →