Python Script to Optimise Images and upload to FTP server

Below is the python script to optimize PNG images files using OPTIPNG library and upload compressed images in FTP folder. If you don't have OPTIPNG library, download from this url: http://optipng.sourceforge.net/ import ftplib import os username = 'username1' pwd = 'pwd1' localdirpath = "/home/username/Documents/screenshots/" files = os.listdir(localdirpath) ftp = ftplib.FTP...

Continue Reading