Python function to resize images and superimpose on one another to find the difference

I am beginner in python. I have multiple images in single directory. I need to compare each image with other all images if they are of equal size if not then scale the other to make it equal size. After that in another python function I need to have 2 images which will convert be converted into red channel and blue channel each. Then superimpose red channel image to blue channel image to find difference between them. Finally store that superimposed image in another folder.

How should I do that? Thanks in advance.

The question doesn’t seem to be PyTorch-related so I would recommend to post it in another board (e.g. StackOverflow) to get a faster and better answer.