As notified by @drpaca, size returns 3 instead of 4. It used to be a 3 element vector for RGB, but now has 4 elements to store alpha since 38179fa4.
size
Hence, 38179fa4 introduced a bug by not fixing the size method return value.