dirList = os.listdir(dirPath)
outPath = 'D:\\Fraps\\Movies\\Screens\\Output'
for dirname, dirs, files in os.walk(dirPath):
    for filename in files:
        if filename.endswith('.png'):
            print('Opening:' + filename)
thefile = os.path.join(dirname, filename)
im = Image.open(thefile)
width, height = im.size
im_rgb = im.convert('RGB')
for x in range(0, width):
    for y in range(0, height):
        r, g, b = im_rgb.getpixel((x, y))
im_rgb.putpixel((x, y), (b, g, r))
print('Saving:' + filename)
outfile = os.path.join(outPath, filename)
im_rgb.save(outfile, 'PNG')
print('Ding!')
Swap R and B color channel values in a directory of images? Python