flatten removes transparency so use it only for ico format