Please bookmark this page to avoid losing your image tool!

Image Veil Wrap And Short Styling 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.
/**
 * Applies a "veil" effect to an image, overlaying it with a translucent pattern.
 * The effect can be a cross-hatch "wrap" or a dotted "short" style.
 *
 * @param {Image} originalImg The original javascript Image object.
 * @param {string} style The style of the veil. Can be 'wrap' for a cross-hatch pattern or 'short' for a dotted pattern. Defaults to 'wrap'.
 * @param {string} color The color of the veil pattern in a CSS format (e.g., 'white', '#FFF', 'rgba(255, 255, 255, 0.4)'). Defaults to 'rgba(255, 255, 255, 0.4)'.
 * @param {number} patternDensity Controls the density of the pattern. Higher numbers result in a tighter pattern. Defaults to 30.
 * @param {number} patternThickness The thickness of the lines or dots in the pattern, in pixels. Defaults to 1.
 * @returns {HTMLCanvasElement} A new canvas element with the veil effect applied.
 */
function processImage(originalImg, style = 'wrap', color = 'rgba(255, 255, 255, 0.4)', patternDensity = 30, patternThickness = 1) {
    // Create a canvas element
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');

    // Get image dimensions
    const width = originalImg.naturalWidth;
    const height = originalImg.naturalHeight;

    // Set canvas dimensions
    canvas.width = width;
    canvas.height = height;

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

    // Prepare to draw the veil pattern
    ctx.strokeStyle = color;
    ctx.fillStyle = color;
    ctx.lineWidth = Math.max(1, patternThickness); // Ensure thickness is at least 1

    // Determine the step size for the pattern based on density
    const step = Math.max(width, height) / Math.max(1, patternDensity);

    if (style === 'wrap') {
        // --- Cross-hatch pattern ("Veil Wrap") ---
        ctx.beginPath();

        // Draw diagonal lines from top-left to bottom-right
        for (let i = -height; i < width; i += step) {
            ctx.moveTo(i, 0);
            ctx.lineTo(i + height, height);
        }

        // Draw diagonal lines from top-right to bottom-left
        for (let i = 0; i < width + height; i += step) {
            ctx.moveTo(i, 0);
            ctx.lineTo(i - height, height);
        }
        ctx.stroke();

    } else if (style === 'short') {
        // --- Dotted pattern ("Veil Short" - like a birdcage veil) ---
        const dotRadius = Math.max(0.5, patternThickness / 2);

        for (let y = step / 2; y < height; y += step) {
            for (let x = step / 2; x < width; x += step) {
                ctx.beginPath();
                ctx.arc(x, y, dotRadius, 0, 2 * Math.PI, false);
                ctx.fill();
            }
        }
    }

    // Return the final canvas
    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 Veil Wrap and Short Styling Tool allows users to apply a creative ‘veil’ effect to images, enhancing their visual appeal through a translucent overlay. Users can choose between two styles of patterns: a cross-hatch ‘wrap’ style and a dotted ‘short’ style. This tool can be used for a variety of applications, such as enhancing photographs for social media, creating artistic effects for digital art, or adding a unique touch to images for presentations and marketing materials. The tool provides customization options including color, pattern density, and thickness to suit individual preferences.

Leave a Reply

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