split qart.go into img.go and qart.go; Encode is now flexible