Please bookmark this page to avoid losing your image tool!

Image Negative Filter Application

(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) {
  // 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 || originalImg.width;
  canvas.height = originalImg.naturalHeight || originalImg.height;

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

  // Get the image data from the canvas
  const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
  const data = imageData.data;

  // Apply the negative filter
  for (let i = 0; i < data.length; i += 4) {
    // Invert Red, Green, and Blue channels
    data[i] = 255 - data[i];     // Red
    data[i + 1] = 255 - data[i + 1]; // Green
    data[i + 2] = 255 - data[i + 2]; // Blue
    // Alpha channel (data[i + 3]) remains unchanged
  }

  // Put the modified image data back onto the canvas
  ctx.putImageData(imageData, 0, 0);

  // Return the canvas element
  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 Negative Filter Application allows users to convert their images into a negative version by inverting the colors of the image. This tool can be useful for various creative projects, artistic expression, or simply for enhancing photos in unique ways. Whether you’re looking to create striking visual content for social media, design projects, or personal artwork, this tool provides an easy way to apply a negative effect to your images.

Leave a Reply

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