how to compute painting square video