init() {
    if (this.initialized()) return;

    this.src = this.image.src; // For same interface with Image
    const w = this.image.width;
    const h = this.image.height;

    // Ease external access
    this.width = w;
    this.height = h;

    const h2 = Math.floor(h / 2);
    const h4 = Math.floor(h / 4);
    const h8 = Math.floor(h / 8);
    const h16 = Math.floor(h / 16);

    const w2 = Math.floor(w / 2);
    const w4 = Math.floor(w / 4);
    const w8 = Math.floor(w / 8);
    const w16 = Math.floor(w / 16);

    // Make canvas as small as possible
    this.canvas.width = 3 * w4;
    this.canvas.height = h2;

    // Coordinates and sizes of images contained in the canvas
    // Values per row:  [top x, left y, width, height]

    this.coordinates = [
      [0, 0, w2, h2],
      [w2, 0, w4, h4],
      [w2, h4, w8, h8],
      [5 * w8, h4, w16, h16],
    ];

    this._fillMipMap();
  }
Called when the image has been successfully loaded.