Please bookmark this page to avoid losing your image tool!

Image Download Tool For Movies Via Torrent

(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.
/**
 * Overlays a stylized button on an image, thematically matching the tool name.
 * This function is for visual effect only and does not perform any file downloads.
 * @param {HTMLImageElement} originalImg The original image object.
 * @param {string} [buttonText="Download Torrent"] The text to display on the button.
 * @param {string} [buttonColor="#1e90ff"] The background color of the button (CSS color).
 * @param {string} [textColor="#ffffff"] The color of the text on the button (CSS color).
 * @param {string} [position="bottom-right"] The position of the button. Accepts "top-left", "top-right", "bottom-left", "bottom-right", "center".
 * @returns {HTMLCanvasElement} A new canvas element with the image and button drawn on it.
 */
function processImage(originalImg, buttonText = "Download Torrent", buttonColor = "#1e90ff", textColor = "#ffffff", position = "bottom-right") {
    // Create a canvas element
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

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

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

    // --- Button Styling and Metrics ---
    // Use a scaling factor based on image size for a responsive feel
    const scale = Math.min(canvas.width, canvas.height) / 1000;
    const fontSize = Math.max(18, 45 * scale); // Set a minimum font size
    const hPadding = fontSize * 1.0;
    const vPadding = fontSize * 0.5;
    const margin = fontSize * 0.5;
    const cornerRadius = fontSize * 0.4;

    ctx.font = `bold ${fontSize}px 'Arial', sans-serif`;
    ctx.textAlign = 'center';
    ctx.textBaseline = 'middle';

    const textMetrics = ctx.measureText(buttonText);
    const buttonWidth = textMetrics.width + hPadding * 2;
    const buttonHeight = fontSize + vPadding * 2;

    // --- Button Positioning ---
    let btnX, btnY;

    switch (position.toLowerCase()) {
        case "top-left":
            btnX = margin;
            btnY = margin;
            break;
        case "top-right":
            btnX = canvas.width - buttonWidth - margin;
            btnY = margin;
            break;
        case "bottom-left":
            btnX = margin;
            btnY = canvas.height - buttonHeight - margin;
            break;
        case "center":
            btnX = (canvas.width - buttonWidth) / 2;
            btnY = (canvas.height - buttonHeight) / 2;
            break;
        case "bottom-right":
        default:
            btnX = canvas.width - buttonWidth - margin;
            btnY = canvas.height - buttonHeight - margin;
            break;
    }

    // --- Draw the Button ---
    // Style for the button background
    ctx.fillStyle = buttonColor;
    ctx.shadowColor = 'rgba(0, 0, 0, 0.5)';
    ctx.shadowBlur = 10;
    ctx.shadowOffsetX = 3 * scale;
    ctx.shadowOffsetY = 3 * scale;

    // Draw rounded rectangle for the button background
    ctx.beginPath();
    ctx.moveTo(btnX + cornerRadius, btnY);
    ctx.lineTo(btnX + buttonWidth - cornerRadius, btnY);
    ctx.quadraticCurveTo(btnX + buttonWidth, btnY, btnX + buttonWidth, btnY + cornerRadius);
    ctx.lineTo(btnX + buttonWidth, btnY + buttonHeight - cornerRadius);
    ctx.quadraticCurveTo(btnX + buttonWidth, btnY + buttonHeight, btnX + buttonWidth - cornerRadius, btnY + buttonHeight);
    ctx.lineTo(btnX + cornerRadius, btnY + buttonHeight);
    ctx.quadraticCurveTo(btnX, btnY + buttonHeight, btnX, btnY + buttonHeight - cornerRadius);
    ctx.lineTo(btnX, btnY + cornerRadius);
    ctx.quadraticCurveTo(btnX, btnY, btnX + cornerRadius, btnY);
    ctx.closePath();
    ctx.fill();

    // Reset shadow before drawing text
    ctx.shadowColor = 'transparent';
    ctx.shadowBlur = 0;
    ctx.shadowOffsetX = 0;
    ctx.shadowOffsetY = 0;

    // Draw the text on the button
    ctx.fillStyle = textColor;
    ctx.fillText(buttonText, btnX + buttonWidth / 2, btnY + buttonHeight / 2 + (fontSize * 0.05)); // Slight vertical adjustment for better centering

    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 Download Tool for Movies via Torrent allows users to visually enhance any image with a stylish overlay button. This button, themed for downloading torrents, can be custom-styled in terms of text, background color, and position on the image. While the tool itself does not facilitate actual downloads, it serves as an effective visual aid for promoting torrent downloads in presentations, thumbnails, or online posts.

Leave a Reply

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