You can edit the below JavaScript code to customize the image tool.
Apply Changes
function processImage(originalImg, bloomStrength = 15, glowIntensity = 0.6, vignetteStrength = 0.8, tintColor = "rgba(255, 230, 200, 0.25)") {
// Create the main canvas
const canvas = document.createElement('canvas');
const width = originalImg.width;
const height = originalImg.height;
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext('2d');
// 1. Draw the original base image with some basic enhancements (contrast/saturation)
ctx.filter = 'contrast(1.1) saturate(1.2) brightness(1.02)';
ctx.drawImage(originalImg, 0, 0, width, height);
// 2. Create the "Nimbus" (glowing halo/bloom) effect using an offscreen canvas
const bloomCanvas = document.createElement('canvas');
bloomCanvas.width = width;
bloomCanvas.height = height;
const bloomCtx = bloomCanvas.getContext('2d');
// Apply a blur for the glowing effect
bloomCtx.filter = `blur(${Number(bloomStrength)}px) brightness(1.1)`;
bloomCtx.drawImage(originalImg, 0, 0, width, height);
// Blend the glow onto the main canvas using 'screen' to brighten and bloom highlights
ctx.filter = 'none';
ctx.globalCompositeOperation = 'screen';
ctx.globalAlpha = Number(glowIntensity);
ctx.drawImage(bloomCanvas, 0, 0, width, height);
// 3. Apply the "Major" overlay tint for an ethereal or slightly vintage color grade
ctx.globalCompositeOperation = 'overlay';
ctx.globalAlpha = 1.0;
ctx.fillStyle = String(tintColor);
ctx.fillRect(0, 0, width, height);
// 4. Create and apply a vignette to frame the glowing effect centrally
ctx.globalCompositeOperation = 'multiply';
const cx = width / 2;
const cy = height / 2;
// Calculate the maximum distance from center to corner
const radius = Math.sqrt(cx * cx + cy * cy);
const gradient = ctx.createRadialGradient(cx, cy, radius * 0.3, cx, cy, radius);
gradient.addColorStop(0, 'rgba(0, 0, 0, 0)');
gradient.addColorStop(0.6, `rgba(0, 0, 0, ${Number(vignetteStrength) * 0.3})`);
gradient.addColorStop(1, `rgba(0, 0, 0, ${Number(vignetteStrength)})`);
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, width, height);
// Reset compositing
ctx.globalCompositeOperation = 'source-over';
return canvas;
}
Apply Changes