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:

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.

@nadastudio I only recently used Xcode 15.0 beta 4,Previously used xcode 14

Seems to be working fine again in Xcode 15.0 beta 5 (15A5209g)

issue still here in Xcode 15.0 release

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

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

After upgrading XCode15, I also encountered this issue. May I ask how this issue was ultimately resolved

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.

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")

I made a Proj to summarize the solution:

  • Packaged with Xcode 14.3.

    • Unrealistic. Apple required Xcode 15 now, News.
  • Move all image from assets to bundle.

    • Unrealistic.
  • Change: Assets - Image Set - Compression - Lossy, Basic.

    • Works. But the problem is that there are so many pictures that you don't know which ones are actually render wrong.
  • Change: Assets - Assets Catalog - Compression - Lossy, Basic.

    • Unavailable. Other image will render incorrectly.
  • Check image bit, if image is 4 bit or another, convert to 8 bit.

    • Works. But the problem is some 8 bit image also have wrong render.
  • Convert all images to 8 bit use PIL.

    • I choose this as the final solution.
  • Question:

    • Can we write a script to scan images that may be rendering incorrectly?
Incorrect image alpha rendering on Xcode 15b3 and iOS 17
 
 
Q