Please bookmark this page to avoid losing your image tool!

Image Hue Adjustment And Horizontal Flip With Pitch Modification 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.
/**
 * Adjusts the hue of an image, flips it horizontally, and acknowledges a pitch modification parameter.
 * @param {Image} originalImg The original javascript Image object to process.
 * @param {number} hueRotationDegrees The degree value to rotate the hue of the image. Defaults to 25.
 * @param {number} flipHorizontally A flag to determine if the image should be flipped horizontally. 1 for yes, 0 for no. Defaults to 1 (yes).
 * @param {number} pitchSemitones This parameter is included to match the tool's description but is not used, as pitch is an audio property. Defaults to 2.
 * @returns {HTMLCanvasElement} A canvas element with the processed image.
 */
function processImage(originalImg, hueRotationDegrees = 25, flipHorizontally = 1, pitchSemitones = 2) {
    // Create a new canvas element
    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;

    // The 'pitchSemitones' parameter is noted here but ignored in the implementation,
    // as pitch shifting is an audio-manipulation task, not an image-manipulation one.
    // The function primarily handles the visual aspects described.

    // Apply the hue rotation filter. The value is in degrees.
    ctx.filter = `hue-rotate(${hueRotationDegrees}deg)`;

    // Check if the image needs to be flipped horizontally
    if (flipHorizontally === 1) {
        // Translate the canvas context to the right edge
        ctx.translate(canvas.width, 0);
        // Scale the context negatively on the x-axis to create a horizontal flip
        ctx.scale(-1, 1);
    }

    // Draw the original image onto the canvas.
    // The transformations (flip) and filters (hue-rotate) will be applied
    // to the image as it is drawn.
    ctx.drawImage(originalImg, 0, 0, originalImg.width, originalImg.height);

    // Return the canvas element with the modified image
    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 Hue Adjustment and Horizontal Flip with Pitch Modification Tool allows users to adjust the color hue of an image and flip it horizontally for creative effects. Users can specify the degree of hue rotation, which alters the color tones, and choose whether to flip the image horizontally, enhancing the aesthetic appeal of pictures. This tool is useful for photographers, graphic designers, and social media enthusiasts looking to creatively modify images for personal or professional projects.

Leave a Reply

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