You can edit the below JavaScript code to customize the image tool.
/**
* This function ignores the input image and draws the famous mammoth
* from the Soviet cartoon "Prostokvashino", as drawn by the character Uncle Fyodor.
* The drawing is created on a new canvas element.
*
* @param {Image} originalImg - An Image object, which is ignored by this function.
* @returns {HTMLCanvasElement} A canvas element with the mammoth drawing.
*/
function processImage(originalImg) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const width = 500;
const height = 450;
canvas.width = width;
canvas.height = height;
// Set a background color similar to a whitewashed stove
ctx.fillStyle = '#f8f8f8';
ctx.fillRect(0, 0, width, height);
// Define the color and style for the mammoth drawing
const mammothBlue = '#4A76A2';
ctx.strokeStyle = mammothBlue;
ctx.fillStyle = mammothBlue;
ctx.lineCap = 'round';
ctx.lineJoin = 'round';
// --- Draw the Mammoth ---
// Legs (drawn first so the body can overlap them)
ctx.lineWidth = 20;
ctx.beginPath();
// Back right leg
ctx.moveTo(360, 290);
ctx.lineTo(360, 390);
// Back left leg
ctx.moveTo(310, 305);
ctx.lineTo(310, 405);
// Front right leg
ctx.moveTo(215, 305);
ctx.lineTo(215, 405);
// Front left leg
ctx.moveTo(170, 290);
ctx.lineTo(170, 390);
ctx.stroke();
// Main Body and Head shape
ctx.lineWidth = 18;
ctx.beginPath();
ctx.moveTo(130, 250); // Start under the chin
// Curve up for the head
ctx.quadraticCurveTo(70, 180, 150, 150);
// Curve over for the back
ctx.quadraticCurveTo(280, 110, 400, 200);
// Curve under for the belly
ctx.quadraticCurveTo(300, 350, 130, 250);
ctx.closePath();
ctx.stroke();
// Give a light 'colored-in' look
ctx.globalAlpha = 0.1;
ctx.fill();
ctx.globalAlpha = 1.0;
// Trunk
ctx.lineWidth = 16;
ctx.beginPath();
ctx.moveTo(120, 222); // Start at the face
ctx.quadraticCurveTo(50, 280, 90, 340);
ctx.stroke();
// Tusks
ctx.lineWidth = 12;
ctx.beginPath();
// Tusk 1
ctx.moveTo(125, 245);
ctx.quadraticCurveTo(160, 240, 170, 270);
// Tusk 2
ctx.moveTo(135, 260);
ctx.quadraticCurveTo(170, 255, 180, 285);
ctx.stroke();
// Ear
ctx.lineWidth = 16;
ctx.beginPath();
ctx.moveTo(180, 150);
ctx.quadraticCurveTo(200, 190, 170, 195);
ctx.stroke();
// Eye
ctx.beginPath();
ctx.arc(140, 180, 5, 0, 2 * Math.PI, false);
ctx.fill();
// Tail
ctx.lineWidth = 10;
ctx.beginPath();
ctx.moveTo(398, 205); // Connect to the rump
ctx.quadraticCurveTo(460, 220, 440, 270);
ctx.stroke();
// Tuft on the tail
ctx.lineWidth = 6;
ctx.beginPath();
ctx.moveTo(440, 270);
ctx.lineTo(450, 260);
ctx.moveTo(440, 270);
ctx.lineTo(430, 280);
ctx.moveTo(440, 270);
ctx.lineTo(450, 280);
ctx.stroke();
return canvas;
}
Free Image Tool Creator
Can't find the image tool you're looking for? Create one based on your own needs now!
This tool enables users to generate an artistic representation of the famous mammoth from the Soviet cartoon ‘Prostokvashino’. It creates a canvas drawing featuring the mammoth in a simplistic and stylized manner, making it suitable for various creative projects, educational purposes, or personal enjoyment. Users can utilize this tool to produce digital artwork, illustrations, or simply to relive nostalgic memories associated with the cartoon.