Depending on value of scax and scay (3) you also maybe read only
the 3rd or so pixel of the img1. So the resulting image is a very rough copy.
Alternatively, you could average the colors of all pixels in each rectangle between 0,0 and scax,scay and repeat this for all rectangles in img1.
But there must be articles about this.
(see Image scaling - Wikipedia
This article is wrong: Image compression - Wikipedia )