image regions can be filled
code refactored