abstract all image processing procedure