Иванasd2,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
canvas {
border: 1px solid red;
}
</style>
</head>
<body>
<canvas id="canvas" height="200" width="400"></canvas>
<script>
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
const image = new Image(60, 45);
const drawLine = (image, from, to, num, ctx) => {
for (let i = 0; i < num; i++) {
let dx = from.x + (to.x - from.x) * i / num;
let dy = from.y + (to.y - from.y) * i / num;
ctx.drawImage(image, dx, dy, 60, 45);
}
}
image.onload = _ => drawLine(image, {
x: 1,
y: 1
}, {
x: 370,
y: 180
}, 12, ctx)
image.src = image.src = 'https://mdn.mozillademos.org/files/5397/rhino.jpg';
</script>
</body>
</html>