То, что вам нужно, это ширина и высота холста. В приведенном ниже примере или обычно предполагается, что изображение слева направо равно 0,0.
const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');
context.fillStyle = 'blue';
context.rect(0, 0, 200, 200);
context.fill();
var width = canvas.width;
var height = canvas.height;
var topLeft =[ 0 , 0];
var topRight = [width,0];
var bottomLeft = [0,height];
var bottomRight = [width,height];
// If you are getting the pixels on the possible points then use this
var topLeft =[ 0 , 0];
var topRight = [width -1,0];
var bottomLeft = [0,height -1 ];
var bottomRight = [width -1,height-1];
<canvas id="canvas" width="400" height="400"><canvas>