Please bookmark this page to avoid losing your image tool!

Ukrainian Text Image 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 = 72, 
    textColor = "#FFD700", 
    outlineColor = "#0057B7", 
    posX = "center", 
    posY = "bottom"
) {
    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 original image onto the canvas
    ctx.drawImage(originalImg, 0, 0);

    // Dynamic scaling for default-looking placement
    const padding = fontSize / 2;

    // Configure text styles, using web-safe fonts that support Cyrillic characters
    ctx.font = `bold ${fontSize}px "Segoe UI", Arial, Helvetica, sans-serif`;
    ctx.fillStyle = textColor;
    ctx.strokeStyle = outlineColor;
    ctx.lineWidth = Math.max(2, fontSize / 12);
    
    // Configure text shadow for better contrast and visibility over varied image backgrounds
    ctx.shadowColor = 'rgba(0, 0, 0, 0.8)';
    ctx.shadowBlur = Math.max(3, fontSize / 10);
    ctx.shadowOffsetX = 2;
    ctx.shadowOffsetY = 2;

    let x, y;

    // Determine X position and alignment
    if (posX.toLowerCase() === 'left') {
        x = padding;
        ctx.textAlign = 'left';
    } else if (posX.toLowerCase() === 'right') {
        x = canvas.width - padding;
        ctx.textAlign = 'right';
    } else {
        x = canvas.width / 2;
        ctx.textAlign = 'center';
    }

    // Determine Y position and baseline
    if (posY.toLowerCase() === 'top') {
        y = padding;
        ctx.textBaseline = 'top';
    } else if (posY.toLowerCase() === 'center' || posY.toLowerCase() === 'middle') {
        y = canvas.height / 2;
        ctx.textBaseline = 'middle';
    } else {
        y = canvas.height - padding;
        ctx.textBaseline = 'bottom';
    }

    // Draw outline and then the solid text
    ctx.strokeText(text, x, y);
    
    // Turn off shadow for standard fill text to prevent muddying the interior color
    ctx.shadowColor = 'transparent';
    ctx.fillText(text, x, y);

    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 Ukrainian Text Image Adder is a tool designed to overlay Ukrainian text onto images. Users can customize the message, font size, text color, and outline color, while also controlling the position of the text (top, center, left, right, etc.) to ensure visibility against various backgrounds. This tool is useful for creating supportive social media graphics, adding localized captions to photos, or personalizing images with Ukrainian phrases and slogans.

Leave a Reply

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