I'm using the new HEIC format to save a masked image to documents directory. When comparing to the PNG version of the same masked image I see that some new articafts have been added.
Here is a screenshot of the effected image:

Here's a link to working repository showcasing this issue (please view the generated image through the new ios 11 Files app). https://github.com/vondiplo/heic_wrong_encode