Please bookmark this page to avoid losing your image tool!

Image To ‘Едем на море’ Text Overlay 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, text = "Едем на море", textColor = "#FFFFFF", strokeColor = "#000000", position = "bottom", fontFamily = "Impact, Arial, sans-serif") {
    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);

    // Calculate a responsive font size based on image dimensions
    let fontSize = Math.max(16, Math.floor(Math.min(canvas.width, canvas.height) / 8));
    ctx.font = `bold ${fontSize}px ${fontFamily}`;
    
    // Scale text down if it's too wide for the canvas (leaving a 10% margin)
    let textMetrics = ctx.measureText(text);
    if (textMetrics.width > canvas.width * 0.9) {
        fontSize = Math.floor((canvas.width * 0.9) / (textMetrics.width / fontSize));
        ctx.font = `bold ${fontSize}px ${fontFamily}`;
    }

    // Configure text styling for a meme-like appearance (fill + outline)
    ctx.textAlign = 'center';
    ctx.textBaseline = 'middle';
    ctx.fillStyle = textColor;
    ctx.strokeStyle = strokeColor;
    ctx.lineWidth = Math.max(2, Math.floor(fontSize / 12));
    ctx.lineJoin = 'round'; // Smoother stroke edges

    // Calculate coordinates based on desired position
    const x = canvas.width / 2;
    let y;
    
    const padding = fontSize; // Distance from the edge
    
    switch (position.toLowerCase().trim()) {
        case 'top':
            y = padding;
            break;
        case 'center':
        case 'middle':
            y = canvas.height / 2;
            break;
        case 'bottom':
        default:
            y = canvas.height - padding;
            break;
    }

    // Draw the stroke (outline) and then the fill text
    ctx.strokeText(text, x, y);
    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

This tool allows users to overlay the specific phrase ‘Едем на море’ onto their images with a customizable meme-style appearance. It features options to adjust the text color, outline color, font family, and the position of the text (top, center, or bottom). The tool automatically scales the font size to ensure the text fits proportionally within the image dimensions, making it useful for creating quick social media posts, humorous travel memes, or themed vacation photos.

Leave a Reply

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