You can edit the below JavaScript code to customize the image tool.
Apply Changes
function processImage(
originalImg,
projectName = "Big Hero 6 (2014) Wonder Project",
channelName = "Amazon Channel",
timestamp = "Jun 30 2028 1:41:52",
addVideoEffect = 1
) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
// Set canvas dimensions to match the original image
canvas.width = originalImg.width;
canvas.height = originalImg.height;
// Draw the original image onto the canvas
ctx.drawImage(originalImg, 0, 0);
// Video effect (Scanlines and slight vignette)
if (addVideoEffect === 1) {
// Scanlines
ctx.fillStyle = 'rgba(0, 0, 0, 0.15)';
for (let i = 0; i < canvas.height; i += 4) {
ctx.fillRect(0, i, canvas.width, 2);
}
// Vignette
const gradient = ctx.createRadialGradient(
canvas.width / 2, canvas.height / 2, Math.max(canvas.width, canvas.height) * 0.4,
canvas.width / 2, canvas.height / 2, Math.max(canvas.width, canvas.height) * 0.8
);
gradient.addColorStop(0, 'rgba(0,0,0,0)');
gradient.addColorStop(1, 'rgba(0,0,0,0.6)');
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
// Responsive font and spacing scales
const padding = Math.max(10, canvas.width * 0.03);
const titleFontSize = Math.max(14, Math.floor(canvas.height * 0.04));
const timeFontSize = Math.max(12, Math.floor(canvas.height * 0.035));
// Helper function to draw text with an outline for readability
function drawText(text, x, y, font, align = "left", baseline = "top", color = "white") {
ctx.font = font;
ctx.textAlign = align;
ctx.textBaseline = baseline;
// Heavy outline for TV-style subtitle/overlay look
ctx.fillStyle = 'black';
ctx.lineWidth = Math.max(2, Math.floor(titleFontSize * 0.15));
ctx.lineJoin = 'round';
ctx.strokeText(text, x, y);
// Fill
ctx.fillStyle = color;
ctx.fillText(text, x, y);
}
// 1. Draw Project Title (Top Left)
drawText(
projectName.toUpperCase(),
padding,
padding,
`bold ${titleFontSize}px "Trebuchet MS", Arial, sans-serif`
);
// 2. Draw Channel Bug/Logo (Top Right)
ctx.font = `bold ${titleFontSize}px "Trebuchet MS", Arial, sans-serif`;
const channelWidth = ctx.measureText(channelName).width;
const boxPad = titleFontSize * 0.5;
const boxX = canvas.width - channelWidth - padding - (boxPad * 2);
const boxY = padding;
// Background box for channel
ctx.fillStyle = 'rgba(0, 0, 0, 0.6)';
ctx.fillRect(boxX, boxY, channelWidth + (boxPad * 2), titleFontSize + (boxPad * 2));
// Emphasize the "Amazon" styling with a small orange underline
ctx.fillStyle = '#FF9900';
ctx.fillRect(boxX, boxY + titleFontSize + (boxPad * 2) - 4, channelWidth + (boxPad * 2), 4);
drawText(
channelName,
canvas.width - padding - boxPad,
padding + boxPad,
`bold ${titleFontSize}px "Trebuchet MS", Arial, sans-serif`,
"right"
);
// 3. Draw Timestamp (Bottom Right)
drawText(
timestamp.toUpperCase(),
canvas.width - padding,
canvas.height - padding,
`${timeFontSize}px "Courier New", Courier, monospace`,
"right",
"bottom"
);
// 4. Draw PLAY / REC indicator (Bottom Left)
const dotRadius = titleFontSize * 0.4;
// Black shadow behind the dot
ctx.beginPath();
ctx.arc(padding + dotRadius, canvas.height - padding - timeFontSize/2, dotRadius + 1, 0, Math.PI * 2);
ctx.fillStyle = 'black';
ctx.fill();
// Red dot
ctx.beginPath();
ctx.arc(padding + dotRadius, canvas.height - padding - timeFontSize/2, dotRadius, 0, Math.PI * 2);
ctx.fillStyle = '#FF0000';
ctx.fill();
drawText(
"PLAY",
padding + (dotRadius * 2) + 10,
canvas.height - padding,
`bold ${timeFontSize}px "Trebuchet MS", Arial, sans-serif`,
"left",
"bottom"
);
return canvas;
}
Apply Changes