This area is not that familiar to me, but since no one else has responded, what are you trying to change exactly? The term "flags" doesn't mean much to me so perhaps you could be more specific.
You seem to suggest you know how to do this with ImageX, do you know what command it might use?