You can edit the below JavaScript code to customize the image tool.
Apply Changes
function processImage(originalImg, overlayOpacity = "0.8", label = "ПЧЁЛОПТИЦЕПЁС") {
// Create a canvas with the same dimensions as the original image
const canvas = document.createElement('canvas');
const cw = originalImg.width;
const ch = originalImg.height;
canvas.width = cw;
canvas.height = ch;
const ctx = canvas.getContext('2d');
// Draw the original base image
ctx.drawImage(originalImg, 0, 0, cw, ch);
const opacity = Math.max(0, Math.min(1, parseFloat(overlayOpacity))) || 0.8;
// Scale features based on the smallest dimension to maintain aspect ratio
const scale = Math.min(cw, ch);
const cx = cw / 2;
const cy = ch / 2;
// Draw Bee Wings in the background (semi-transparent)
ctx.save();
ctx.globalAlpha = opacity;
ctx.fillStyle = "#A7D8DE";
ctx.strokeStyle = "rgba(0, 0, 0, 0.5)";
ctx.lineWidth = Math.max(2, scale * 0.005);
// Left Wings
ctx.beginPath();
ctx.ellipse(cx - scale * 0.35, cy - scale * 0.1, scale * 0.2, scale * 0.08, -Math.PI / 6, 0, Math.PI * 2);
ctx.fill(); ctx.stroke();
ctx.beginPath();
ctx.ellipse(cx - scale * 0.3, cy + scale * 0.05, scale * 0.12, scale * 0.05, -Math.PI / 8, 0, Math.PI * 2);
ctx.fill(); ctx.stroke();
// Right Wings
ctx.beginPath();
ctx.ellipse(cx + scale * 0.35, cy - scale * 0.1, scale * 0.2, scale * 0.08, Math.PI / 6, 0, Math.PI * 2);
ctx.fill(); ctx.stroke();
ctx.beginPath();
ctx.ellipse(cx + scale * 0.3, cy + scale * 0.05, scale * 0.12, scale * 0.05, Math.PI / 8, 0, Math.PI * 2);
ctx.fill(); ctx.stroke();
ctx.restore();
// Draw Bee Antennae
ctx.save();
ctx.strokeStyle = "#111111";
ctx.lineWidth = Math.max(3, scale * 0.01);
ctx.lineCap = "round";
// Left Antenna
ctx.beginPath();
ctx.moveTo(cx - scale * 0.1, cy - scale * 0.25);
ctx.quadraticCurveTo(cx - scale * 0.15, cy - scale * 0.45, cx - scale * 0.25, cy - scale * 0.4);
ctx.stroke();
// Right Antenna
ctx.beginPath();
ctx.moveTo(cx + scale * 0.1, cy - scale * 0.25);
ctx.quadraticCurveTo(cx + scale * 0.15, cy - scale * 0.45, cx + scale * 0.25, cy - scale * 0.4);
ctx.stroke();
// Antenna Balls
ctx.fillStyle = "#FFD700"; // Gold/Yellow
ctx.beginPath(); ctx.arc(cx - scale * 0.25, cy - scale * 0.4, scale * 0.035, 0, Math.PI * 2); ctx.fill(); ctx.stroke();
ctx.beginPath(); ctx.arc(cx + scale * 0.25, cy - scale * 0.4, scale * 0.035, 0, Math.PI * 2); ctx.fill(); ctx.stroke();
ctx.restore();
// Draw Floppy Dog Ears
ctx.save();
ctx.fillStyle = "#6B4D2B";
ctx.strokeStyle = "#402D18";
ctx.lineWidth = Math.max(2, scale * 0.005);
// Left Ear
ctx.beginPath();
ctx.moveTo(cx - scale * 0.15, cy - scale * 0.25);
ctx.quadraticCurveTo(cx - scale * 0.35, cy - scale * 0.2, cx - scale * 0.3, cy + scale * 0.1);
ctx.quadraticCurveTo(cx - scale * 0.15, cy + scale * 0.15, cx - scale * 0.1, cy - scale * 0.1);
ctx.fill(); ctx.stroke();
// Right Ear
ctx.beginPath();
ctx.moveTo(cx + scale * 0.15, cy - scale * 0.25);
ctx.quadraticCurveTo(cx + scale * 0.35, cy - scale * 0.2, cx + scale * 0.3, cy + scale * 0.1);
ctx.quadraticCurveTo(cx + scale * 0.15, cy + scale * 0.15, cx + scale * 0.1, cy - scale * 0.1);
ctx.fill(); ctx.stroke();
// Inner Ears (Pinkish Brown)
ctx.fillStyle = "#C39A70";
ctx.beginPath();
ctx.moveTo(cx - scale * 0.17, cy - scale * 0.15);
ctx.quadraticCurveTo(cx - scale * 0.3, cy - scale * 0.12, cx - scale * 0.27, cy + scale * 0.05);
ctx.quadraticCurveTo(cx - scale * 0.17, cy + scale * 0.1, cx - scale * 0.13, cy - scale * 0.05);
ctx.fill();
ctx.beginPath();
ctx.moveTo(cx + scale * 0.17, cy - scale * 0.15);
ctx.quadraticCurveTo(cx + scale * 0.3, cy - scale * 0.12, cx + scale * 0.27, cy + scale * 0.05);
ctx.quadraticCurveTo(cx + scale * 0.17, cy + scale * 0.1, cx + scale * 0.13, cy - scale * 0.05);
ctx.fill();
ctx.restore();
// Draw Bird Beak
ctx.save();
ctx.fillStyle = "#FF9900";
ctx.strokeStyle = "#885500";
ctx.lineWidth = Math.max(2, scale * 0.005);
ctx.lineJoin = "round";
// Top Beak
ctx.beginPath();
ctx.moveTo(cx - scale * 0.08, cy + scale * 0.12);
ctx.lineTo(cx + scale * 0.08, cy + scale * 0.12);
ctx.lineTo(cx, cy + scale * 0.25);
ctx.closePath();
ctx.fill(); ctx.stroke();
// Inner mouth line / lower beak shadow effect
ctx.fillStyle = "#D68000";
ctx.beginPath();
ctx.moveTo(cx - scale * 0.06, cy + scale * 0.14);
ctx.lineTo(cx + scale * 0.06, cy + scale * 0.14);
ctx.lineTo(cx, cy + scale * 0.23);
ctx.closePath();
ctx.fill(); ctx.stroke();
ctx.restore();
// Draw Dog Nose right above the beak
ctx.save();
ctx.fillStyle = "#111111";
ctx.beginPath();
ctx.ellipse(cx, cy + scale * 0.05, scale * 0.08, scale * 0.05, 0, 0, Math.PI * 2);
ctx.fill();
// Nose shine reflection
ctx.fillStyle = "rgba(255, 255, 255, 0.4)";
ctx.beginPath();
ctx.ellipse(cx - scale * 0.02, cy + scale * 0.03, scale * 0.03, scale * 0.015, -Math.PI / 8, 0, Math.PI * 2);
ctx.fill();
ctx.restore();
// Meme text generation
const cleanLabel = String(label).trim();
if (cleanLabel !== "") {
ctx.save();
const fontSize = Math.max(20, scale * 0.1);
ctx.font = `bold ${fontSize}px Impact, "Arial Black", sans-serif`;
ctx.textAlign = "center";
ctx.textBaseline = "bottom";
// Draw black stroke around white text
ctx.lineWidth = fontSize * 0.06;
ctx.strokeStyle = "#000000";
ctx.fillStyle = "#FFFFFF";
ctx.strokeText(cleanLabel, cx, ch - (scale * 0.05));
ctx.fillText(cleanLabel, cx, ch - (scale * 0.05));
ctx.restore();
}
return canvas;
}
Apply Changes