Please bookmark this page to avoid losing your image tool!

Image Language Editor

(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.
async function processImage(
    originalImg,
    text = "Enter translated text here",
    fontFamily = "Arial",
    fontSize = 32,
    textColor = "#FFFFFF",
    textBgColor = "transparent",
    strokeColor = "#000000",
    strokeWidth = 2,
    xPercent = 50,
    yPercent = 80
) {
    // Attempt to dynamically load Google / Custom Font if it isn't a standard web-safe font
    const webSafeFonts = [
        "Arial", "Verdana", "Helvetica", "Tahoma", "Trebuchet MS", 
        "Times New Roman", "Georgia", "Garamond", "Courier New", 
        "Brush Script MT", "sans-serif", "serif", "monospace"
    ];
    
    if (!webSafeFonts.includes(fontFamily)) {
        const fontUrl = `https://fonts.googleapis.com/css2?family=${fontFamily.replace(/ /g, '+')}&display=swap`;
        if (!document.querySelector(`link[href="${fontUrl}"]`)) {
            const link = document.createElement('link');
            link.href = fontUrl;
            link.rel = 'stylesheet';
            document.head.appendChild(link);
        }
        try {
            // Wait for the font to be loaded to render correctly on the canvas
            await document.fonts.load(`${fontSize}px "${fontFamily}"`);
        } catch (e) {
            console.warn(`Could not load font: ${fontFamily}, falling back to default.`, e);
        }
    }

    // Set up canvas
    const canvas = document.createElement("canvas");
    canvas.width = originalImg.width;
    canvas.height = originalImg.height;
    const ctx = canvas.getContext("2d");

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

    // Apply text styling
    ctx.font = `${fontSize}px "${fontFamily}", sans-serif`;
    ctx.fillStyle = textColor;
    ctx.strokeStyle = strokeColor;
    ctx.lineWidth = strokeWidth;
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";

    // Support multiline text inputs (split by \n or literal slash-n)
    const lines = text.split(/\\n|\n/);
    const x = (canvas.width * xPercent) / 100;
    let y = (canvas.height * yPercent) / 100;
    
    const lineHeight = fontSize * 1.2;
    // Adjust Y so the block of text is centered around the given percentage point
    y -= (lines.length * lineHeight) / 2 - (lineHeight / 2);

    // If a text background color is provided (such as for replacing original comic/manga language text)
    if (textBgColor && textBgColor !== "transparent" && textBgColor !== "rgba(0,0,0,0)") {
        const padding = fontSize * 0.5;
        const maxLineWidth = Math.max(...lines.map(line => ctx.measureText(line).width));
        const totalHeight = lines.length * lineHeight;
        
        ctx.fillStyle = textBgColor;
        ctx.fillRect(
             x - (maxLineWidth / 2) - padding,
             y - (lineHeight / 2) - padding,
             maxLineWidth + padding * 2,
             totalHeight + padding * 2
        );
        // Restore text color
        ctx.fillStyle = textColor;
    }

    // Render the text lines
    for (const line of lines) {
        if (strokeWidth > 0 && strokeColor !== "transparent") {
            ctx.strokeText(line, x, y);
        }
        ctx.fillText(line, x, y);
        y += 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 Language Editor is a tool designed to overlay custom text onto existing images. It allows users to customize the text content, font family, font size, color, and stroke properties, as well as the position of the text on the image. Additionally, it supports adding a background color behind the text to improve readability. This tool is particularly useful for translating text within images, such as memes, comics, or instructional graphics, and for creating personalized visual content with specific messaging.

Leave a Reply

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

Other Image Tools:

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

TV Icon Image Converter

See All →