Please bookmark this page to avoid losing your image tool!

Image Happy Mood Enhancer

(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.
/**
 * Enhances the "happy mood" of an image by increasing its brightness, saturation, and warmth.
 * @param {HTMLImageElement} originalImg The original image element to process.
 * @param {number} intensity A number between 0 and 1 to control the strength of the enhancement. Defaults to 0.8.
 * @returns {HTMLCanvasElement} A new canvas element with the happy mood effect applied.
 */
function processImage(originalImg, intensity = 0.8) {
  // Create a canvas element
  const canvas = document.createElement('canvas');
  const ctx = canvas.getContext('2d');

  // Set canvas dimensions to match the original image
  // Use naturalWidth/Height to ensure we get the true image dimensions
  canvas.width = originalImg.naturalWidth;
  canvas.height = originalImg.naturalHeight;

  // Clamp the intensity value to be between 0 and 1 for safety
  const effectIntensity = Math.max(0, Math.min(1, intensity));

  // A "happy" image is often brighter, more colorful (saturated), and slightly warmer.
  // We can achieve this using the canvas context's filter property.
  
  // Calculate filter values based on the intensity
  // Brightness: Increases from 100% to 115% based on intensity
  const brightness = 1 + (0.15 * effectIntensity);
  // Saturation: Increases from 100% to 140% based on intensity
  const saturation = 1 + (0.4 * effectIntensity);
  // Warmth (subtle sepia): Increases from 0% to 15% based on intensity
  const warmth = 0.15 * effectIntensity;

  // Construct the CSS filter string
  ctx.filter = `brightness(${brightness}) saturate(${saturation}) sepia(${warmth})`;
  
  // Draw the original image onto the canvas. The filter will be applied automatically.
  ctx.drawImage(originalImg, 0, 0, canvas.width, canvas.height);

  // Return the canvas with the enhanced 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 Happy Mood Enhancer is a tool designed to improve the visual appeal of images by enhancing their brightness, saturation, and warmth. This tool can be particularly useful for creating uplifting visuals suitable for social media posts, marketing materials, or personal projects where a cheerful aesthetic is desired. Users can control the intensity of the enhancement, allowing for a customized effect that suits various preferences and styles.

Leave a Reply

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