using CImg and GridCut,