Please bookmark this page to avoid losing your image tool!

Image Mirror And Flip 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, flipHorizontal = 'true', flipVertical = 'false') {
    // Determine the boolean values from the string parameters
    const isHoriz = flipHorizontal.toLowerCase() === 'true';
    const isVert = flipVertical.toLowerCase() === 'true';

    // Create a new canvas element
    const canvas = document.createElement('canvas');
    canvas.width = originalImg.width;
    canvas.height = originalImg.height;
    const ctx = canvas.getContext('2d');

    // Calculate scale and translation values based on flip options
    const scaleX = isHoriz ? -1 : 1;
    const scaleY = isVert ? -1 : 1;
    const translateX = isHoriz ? canvas.width : 0;
    const translateY = isVert ? canvas.height : 0;

    // Apply transformation
    ctx.translate(translateX, translateY);
    ctx.scale(scaleX, scaleY);

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

    // Reset transformation to default (optional but good practice)
    ctx.setTransform(1, 0, 0, 1, 0, 0);

    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 Mirror and Flip Tool allows users to reflect their images either horizontally, vertically, or both simultaneously. This utility is useful for correcting the orientation of photos, creating symmetrical patterns, or adjusting selfies and product images for better visual presentation in social media, graphic design, or web content.

Leave a Reply

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