Note that the number of pixels in the image is scaled by 1/4 when going up the pyramid (not 1/2, as indicated in your original post). Referencing the Geometric series wiki article, the closed form solution of the geometric series is:
$\sum_{k=0}^{\infty} a(r)^{k} = \frac{a}{1-r}$
By plugging in $r = 1/4$, we therefore get the following result:
Sorry I forget how we get 4/3? I was trying to do like original_size * (1/2 + 1/4 + 1/8 + 1/16 + ...) and got a close size of the original image.
Good question. The size of the pyramid is given by the following geometric series:
$\text{original_size} * \sum_{k=0}^{\infty} (1/4)^{k}$
Note that the number of pixels in the image is scaled by 1/4 when going up the pyramid (not 1/2, as indicated in your original post). Referencing the Geometric series wiki article, the closed form solution of the geometric series is:
$\sum_{k=0}^{\infty} a(r)^{k} = \frac{a}{1-r}$
By plugging in $r = 1/4$, we therefore get the following result:
$\frac{\text{original_size}}{1-\frac{1}{4}} = 4/3 * \text{original_size}$