Thanks Lulu for the nice comment and the fix. The program seems to work more efficiently now in the blur mode, especially on my Intel CPU work laptop. I initially used floating points but found the speed too slow so I switched to integer calculations for faster rendering.
After I uploaded the source I found that the program was seizing up after a while but could not work out why, until you worked it out. Need to remember BGRAReplace for future projects.
Your help was greatly appreciated. Thank you.
Also noticed a pulsating pattern if you set divisor2 = 5.00