You can edit the below JavaScript code to customize the image tool.
Apply Changes
function processImage(originalImg, intensityStr = '1.0', warmthStr = '1.0', glowStr = '1.0') {
const intensity = parseFloat(intensityStr);
const warmth = parseFloat(warmthStr);
const glow = parseFloat(glowStr);
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = originalImg.width;
canvas.height = originalImg.height;
// Draw original image
ctx.drawImage(originalImg, 0, 0);
// Apply the "Mina-Girl" soft film and warm pastel tint
const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const data = imgData.data;
// We lower contrast and increase brightness for a relaxed, airy fashion look
const contrast = 1.0 - (0.15 * intensity);
const brightness = 15 * intensity;
for (let i = 0; i < data.length; i += 4) {
let r = data[i];
let g = data[i + 1];
let b = data[i + 2];
// 1. Adjust global contrast and brightness
r = (r - 128) * contrast + 128 + brightness;
g = (g - 128) * contrast + 128 + brightness;
b = (b - 128) * contrast + 128 + brightness;
// 2. Add Warm Peach/Pink Tint (Kawaii / Pop-fashion aesthetic)
r += 20 * warmth * intensity;
g += 10 * warmth * intensity;
b -= 10 * warmth * intensity;
// 3. Fade Blacks (creating a vintage film-like shadow)
const fadeR = 35 * intensity;
const fadeG = 25 * intensity;
const fadeB = 30 * intensity;
r = r * (255 - fadeR) / 255 + fadeR;
g = g * (255 - fadeG) / 255 + fadeG;
b = b * (255 - fadeB) / 255 + fadeB;
// Clamp colors between 0 and 255
data[i] = Math.min(255, Math.max(0, r));
data[i + 1] = Math.min(255, Math.max(0, g));
data[i + 2] = Math.min(255, Math.max(0, b));
}
ctx.putImageData(imgData, 0, 0);
// "Major" Dreamy Glow Effect (Soft focus / Bloom overlay)
if (glow > 0) {
const blurCanvas = document.createElement('canvas');
blurCanvas.width = canvas.width;
blurCanvas.height = canvas.height;
const blurCtx = blurCanvas.getContext('2d');
// Use standard canvas filter for blooming
const blurRadius = Math.max(canvas.width, canvas.height) * 0.015 * glow;
blurCtx.filter = `blur(${blurRadius}px) brightness(1.1)`;
blurCtx.drawImage(canvas, 0, 0);
ctx.globalCompositeOperation = 'screen';
ctx.globalAlpha = 0.35 * glow;
ctx.drawImage(blurCanvas, 0, 0);
ctx.globalAlpha = 1.0;
ctx.globalCompositeOperation = 'source-over';
}
// Add a stylish Light Leak / Vignette for the magazine-like vibe
ctx.globalCompositeOperation = 'screen';
const lightLeak = ctx.createLinearGradient(0, 0, canvas.width * 0.6, canvas.height * 0.6);
lightLeak.addColorStop(0, `rgba(255, 170, 150, ${0.4 * intensity})`);
lightLeak.addColorStop(0.5, `rgba(255, 200, 200, ${0.1 * intensity})`);
lightLeak.addColorStop(1, 'rgba(255, 255, 255, 0)');
ctx.fillStyle = lightLeak;
ctx.fillRect(0, 0, canvas.width, canvas.height);
// Reset composite operation to normal
ctx.globalCompositeOperation = 'source-over';
return canvas;
}
Apply Changes