You can edit the below JavaScript code to customize the image tool.
Apply Changes
function processImage(originalImg, auTitle = "[SFIT_SECURE_LINK] BH6 Alternate Universe", themeColor = "#df2b2b", glitchIntensity = 15) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
// Set canvas dimensions to match the original image
const w = originalImg.width;
const h = originalImg.height;
canvas.width = w;
canvas.height = h;
// 1. Draw the original image
ctx.drawImage(originalImg, 0, 0, w, h);
// 2. Apply Glitch Effect (A/V Replacer Override visual)
const numGlitches = Math.max(0, parseInt(glitchIntensity));
for (let i = 0; i < numGlitches; i++) {
const sliceY = Math.random() * h;
const sliceH = Math.random() * (h * 0.05) + 2;
const offsetX = (Math.random() - 0.5) * (w * 0.08);
ctx.drawImage(canvas, 0, sliceY, w, sliceH, offsetX, sliceY, w, sliceH);
}
// 3. Apply Video Scanlines & Dark Vignette
ctx.fillStyle = "rgba(0, 0, 0, 0.15)";
for (let i = 0; i < h; i += 4) {
ctx.fillRect(0, i, w, 2);
}
const gradient = ctx.createRadialGradient(w/2, h/2, Math.min(w,h) * 0.2, w/2, h/2, Math.min(w,h) * 0.8);
gradient.addColorStop(0, "rgba(0, 0, 0, 0)");
gradient.addColorStop(1, "rgba(0, 0, 0, 0.4)");
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, w, h);
const pad = Math.min(w, h) * 0.05;
// 4. Draw San Fransokyo Tech / BH6 Style HUD Overlays
ctx.strokeStyle = themeColor;
ctx.lineWidth = Math.max(2, w * 0.003);
// Corner brackets
const bracketLen = Math.min(w, h) * 0.1;
const drawBracket = (x, y, dx, dy) => {
ctx.beginPath();
ctx.moveTo(x + dx, y);
ctx.lineTo(x, y);
ctx.lineTo(x, y + dy);
ctx.stroke();
};
drawBracket(pad, pad, bracketLen, bracketLen); // Top Left
drawBracket(w - pad, pad, -bracketLen, bracketLen); // Top Right
drawBracket(pad, h - pad, bracketLen, -bracketLen); // Bottom Left
drawBracket(w - pad, h - pad, -bracketLen, -bracketLen); // Bottom Right
// Draw Hexagons (Hiro's microbots / SFIT tech motif)
const drawHex = (cx, cy, r) => {
ctx.beginPath();
for (let i = 0; i < 6; i++) {
const angle = (Math.PI / 3) * i + (Math.PI / 6);
const hx = cx + r * Math.cos(angle);
const hy = cy + r * Math.sin(angle);
if (i === 0) ctx.moveTo(hx, hy);
else ctx.lineTo(hx, hy);
}
ctx.closePath();
ctx.stroke();
};
// Hex cluster on the right border
ctx.fillStyle = "rgba(223, 43, 43, 0.2)";
const hexRadius = Math.min(w, h) * 0.02;
for(let i=0; i<3; i++) {
drawHex(w - pad - hexRadius, h/2 + (i * hexRadius * 1.8), hexRadius);
if (i === 1) ctx.fill(); // Fill middle hex
}
// 5. Draw Video Player / Audio Replacer Interface
// Audio Waveform Visualizer
const waveY = h - pad - (h * 0.06);
const waveW = w - (pad * 2);
ctx.beginPath();
ctx.moveTo(pad, waveY);
for (let x = 0; x <= waveW; x += 4) {
let amp = (Math.random() * (h * 0.03)) * Math.sin(x * 0.05);
if (x < waveW * 0.1 || x > waveW * 0.9) amp *= 0.2; // Taper ends
ctx.lineTo(pad + x, waveY - amp);
}
ctx.stroke();
// Video Process Bar
const barY = h - pad - (h * 0.02);
ctx.fillStyle = "rgba(255, 255, 255, 0.3)";
ctx.fillRect(pad + (w*0.05), barY, waveW - (w*0.05), h * 0.005);
ctx.fillStyle = themeColor;
ctx.fillRect(pad + (w*0.05), barY, (waveW - (w*0.05)) * 0.42, h * 0.005); // 42% progress (42 is prominent in nerdy sci-fi context)
// Media Play Button Triangle
ctx.beginPath();
const playX = pad + (w*0.01);
const playY = barY + (h * 0.0025);
const playSize = h * 0.015;
ctx.moveTo(playX, playY - playSize/1.5);
ctx.lineTo(playX + playSize, playY);
ctx.lineTo(playX, playY + playSize/1.5);
ctx.fill();
// 6. Add Text/Typography Overlays
const fontSize = Math.max(12, h * 0.03);
ctx.font = `bold ${fontSize}px "Courier New", Courier, monospace`;
ctx.textAlign = "left";
// Top Left: Title and Override status
ctx.fillStyle = themeColor;
ctx.fillText(auTitle.toUpperCase(), pad * 1.5, pad * 1.5);
ctx.fillStyle = "#ffffff";
ctx.fillText("AUDIO/VIDEO REPLACER OVERRIDE: ACTIVE", pad * 1.5, pad * 1.5 + fontSize * 1.2);
// Top left databank info
ctx.font = `${Math.max(10, fontSize * 0.6)}px "Courier New", Courier, monospace`;
ctx.fillStyle = "rgba(255, 255, 255, 0.7)";
ctx.fillText(`FRM: ${w}x${h} || CH: BAYMAX-OSv3`, pad * 1.5, pad * 1.5 + fontSize * 2.2);
// Top Right: REC Blinker
ctx.textAlign = "right";
ctx.fillStyle = "red";
ctx.beginPath();
ctx.arc(w - pad * 1.5 - (fontSize * 3), pad * 1.5 - (fontSize*0.3), fontSize * 0.4, 0, Math.PI * 2);
ctx.fill();
ctx.fillStyle = "#ffffff";
ctx.font = `bold ${fontSize}px "Courier New", Courier, monospace`;
ctx.fillText("REC", w - pad * 1.5, pad * 1.5);
// Bottom Timecodes
ctx.textAlign = "left";
ctx.font = `bold ${Math.max(10, h * 0.015)}px sans-serif`;
ctx.fillText("14:02:42", pad + (w*0.05), barY + (h * 0.025));
ctx.textAlign = "right";
ctx.fillText("33:21:00", w - pad, barY + (h * 0.025));
return canvas;
}
Apply Changes