Incorrect image alpha rendering on Xcode 15b3 and iOS 17

I'm not sure if I'm changed an unknown-to-me setting somewhere, but since this morning, after profiling an app (metal, allocations, etc), every project I run/build on Xcode 15b3, either on simulator or on device, displays partially-alpha images blended to black, as if there was some problem in the process of compiling the PNGs (lack of premultiplying, color space, etc).

If I open those same projects on Xcode 14, they are displayed everything as they should. Also, If I open them on other computers with Xcode 15b3 other than mine, it also works fine. And it was working fine for me this morning as well, but not anymore.

I've tried uninstalling Xcode beta and the simulator a few times, cleaning folders and preferences, hoping it was some setting I changed by mistake with some hotkey, but no luck so far.

I'll attach two pictures, one from Xcode 14, and the other one from Xcode 15b3, hoping it's some silly thing I'm missing.

xc15b3:

xc14:

Post not yet marked as solved Up vote post of nadastudio Down vote post of nadastudio
3.4k views
  • Facing same issue with Xcode Version 15.0 beta 4 (15A5195m)

  • I also have the same problem Xcode Version 15.0 beta 4 (15A5195m)

  • [@Sathana S.](https://developer.apple.com/forums/profile/Sathana S.) @zhaozhiqiang I'm still having issues with beta 4 as well. Do you recall when it started happening to you? Did you use the Profiler by any chance? I'm trying to pinpoint what could have gone wrong.

Replies

Any luck with this problem ? Faced this in Xcode 15.0 (15A240d) release version.

  • For me it fixed itself on 15.0 RC. However I see you found a solution changing compression to basic; will try if it happens again.

  • I also faced the same issue in Xcode 15.0 (15A240d) release version. And the solution that @nadastudio suggested didn't work either.

Add a Comment

Found the solution. Need to change compression type to "Basic"

  • it's working!! thank you and shame on apple !!

  • uselessly.It work well in iOS 17.0.2 but bad in iOS 17.0.1

    in iOS 17.0.1 it's a white picture

  • It's work! Thank you so much!

After upgrading to xcode15, I also encountered this issue where images with transparent channels will have gray fill when running. I would like to ask how this problem was ultimately resolved.

We still have same issue on Xcode 15.1 beta.

I find PNG with alpha in Assets.car is compressed with 'Gray' color space.

I think 'Gray' color space is no problem.

But there is a huge difference of compression results between Xcode 14 and Xcode 15.

The issue is still occurring in xcode version 15.0.1 (15A507). Is there a correct solution?

You can check the bits/channel of the png, if the png is 4 bits/channel, you can export to 8 bits/channel.

  • 8 bits/channel works. Thanks.

  • you are right, and i wrote this shell to check and change the png in the shell folder, hope this help change_png_bit.sh

Add a Comment

this issue is still occurring in xcode version 15.2 (15C500b).

Is there anyone tried to send a feedback to Apple?

I found an ugly solution to this problem, just drag image from Assets.xcassets to project。

just use UIImage(named: "btn_trend_release") works well。

but app size may increase

as LimingWan said trans png to 8 bit is fine。 simple use python fix

install PIL

pip install pillow

from PIL import Image

def deal_png_at_location(root):
    for root, dirs, files in os.walk(root):
        for file in files:
            if file.endswith(".png"):
                img_path = os.path.join(root, file)
                img = Image.open(img_path)
                # whether this file is an 8-bit png, skip it if not
                if img.mode != "P":
                    continue
                img = img.convert("RGBA")
                img.save(img_path)

deal_png_at_location("./Assets.xcassets")