You can edit the below JavaScript code to customize the image tool.
Apply Changes
function processImage(
originalImg,
mediaFormat = "VHSRip",
audioFormat = "HIFI STEREO",
languageDub = "English Dub",
identifierStatus = "IDENTIFIED: LOCALIZATION MATCH",
showScanlines = 1 // 1 for Yes, 0 for No
) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const width = originalImg.width;
const height = originalImg.height;
canvas.width = width;
canvas.height = height;
// Draw the original image
ctx.drawImage(originalImg, 0, 0, width, height);
// If simulating a VHSRip, add CRT scanline effects
if (showScanlines === 1 || mediaFormat.toLowerCase().includes("vhs")) {
ctx.fillStyle = 'rgba(0, 0, 0, 0.15)';
for (let i = 0; i < height; i += 4) {
ctx.fillRect(0, i, width, 2);
}
// Add slight RGB shift (chromatic aberration) simulation to make it look like old media
const imgData = ctx.getImageData(0, 0, width, height);
const data = imgData.data;
for (let i = 0; i < data.length; i += 4) {
if (i % 12 === 0) {
// Shift red channel slightly to the right
if (i + 4 < data.length) {
data[i] = data[i + 4];
}
}
}
ctx.putImageData(imgData, 0, 0);
}
// Dynamic base font sizing based on image dimensions
const baseFontSize = Math.max(14, Math.floor(height * 0.04));
const smallFontSize = Math.max(10, Math.floor(height * 0.025));
const largeFontSize = Math.max(18, Math.floor(height * 0.06));
// Draw top dark overlay for UI readability
ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';
ctx.fillRect(0, 0, width, baseFontSize * 2.5);
// Draw bottom dark overlay for UI readability
ctx.fillRect(0, height - baseFontSize * 2.5, width, baseFontSize * 2.5);
// Configure font styles to mimic an old TV player / VCR OSD (On-Screen Display)
ctx.font = `bold ${baseFontSize}px "Courier New", Courier, monospace`;
ctx.textBaseline = 'middle';
// --- TOP UI BARS ---
// Top Left: Player Status & Search TV
ctx.textAlign = 'left';
ctx.fillStyle = '#00FF00'; // VCR Green
ctx.fillText("► PLAY", 15, baseFontSize * 1.25);
// Time code
ctx.fillStyle = '#FFFFFF';
ctx.font = `bold ${smallFontSize}px "Courier New", Courier, monospace`;
ctx.fillText("SEARCH TV :: Media Identifier Tool", 15 + ctx.measureText("► PLAY ").width + 10, baseFontSize * 1.25);
// Top Right: Audio format (e.g. HIFI STEREO)
ctx.textAlign = 'right';
ctx.fillStyle = '#FFFF00'; // VCR Yellow
ctx.font = `bold ${baseFontSize}px "Courier New", Courier, monospace`;
ctx.fillText(`[ ${audioFormat} ]`, width - 15, baseFontSize * 1.25);
// --- BOTTOM UI BARS ---
// Bottom Left: Media Format and Language (e.g. VHSRip English Dub)
ctx.textAlign = 'left';
ctx.fillStyle = '#00FFFF'; // Cyan
ctx.fillText(`${mediaFormat} | ${languageDub}`, 15, height - baseFontSize * 1.25);
// Bottom Right: Fake Tool/Download Promo
ctx.textAlign = 'right';
ctx.fillStyle = '#FF00FF'; // Magenta
ctx.font = `bold ${smallFontSize}px "Courier New", Courier, monospace`;
ctx.fillText("▼ DOWNLOAD TOOL CREATOR", width - 15, height - baseFontSize * 1.25);
// --- CENTER: IDENTIFIER OVERLAY ---
ctx.font = `bold ${largeFontSize}px Arial, sans-serif`;
const textWidth = ctx.measureText(identifierStatus).width;
// Semi-transparent center box
ctx.fillStyle = 'rgba(0, 0, 0, 0.7)';
const boxPaddingX = 20;
const boxPaddingY = 15;
const boxHeight = largeFontSize + boxPaddingY * 2;
const boxY = (height / 2) - (boxHeight / 2);
ctx.fillRect(
(width / 2) - (textWidth / 2) - boxPaddingX,
boxY,
textWidth + boxPaddingX * 2,
boxHeight
);
// Center text stroke
ctx.lineWidth = Math.max(2, Math.floor(largeFontSize * 0.05));
ctx.strokeStyle = '#000000';
ctx.textAlign = 'center';
ctx.strokeText(identifierStatus, width / 2, height / 2);
// Center text fill
ctx.fillStyle = '#FFFFFF';
ctx.fillText(identifierStatus, width / 2, height / 2);
// Return the generated canvas containing the visually augmented image
return canvas;
}
Apply Changes