load the logo image loop over all png and jpg files in the working directory check whether the image is wider or taller than pixels if soreduce the width or height (whichever is largerto pixels and scale down the other dimension proportionally paste the logo image into the corner save the altered images to another folder this means the code will need to do the following open the catlogo png file as an image object loop over the strings returned from os listdir('get the width and height of the image from the size attribute calculate the new width and height of the resized image call the resize(method to resize the image call the paste(method to paste the logo call the save(method to save the changesusing the original filename step open the logo image for this projectopen new file editor tabenter the following codeand save it as resizeandaddlogo py#python resizeandaddlogo py resizes all images in current working directory to fit in squareand adds catlogo png to the lower-right corner import os from pil import image square_fit_size logo_filename 'catlogo pngw logoim image open(logo_filenamex logowidthlogoheight logoim size todoloop over all files in the working directory todocheck if image needs to be resized todocalculate the new width and height to resize to todoresize the image todoadd the logo todosave changes manipulating images