[ios] Images can't contain alpha channels or transparencies

Apple has released new version of iTunes Connect & I got an error message when I tried to set Screenshots on itunes connect for my app.

"Images can't contain alpha channels or transparencies." 

enter image description here

This question is related to ios iphone itunes app-store-connect

The answer is


To get around the problem I batched converted using fireworks my png32 files to png24 for upload quick and easy. Jpeg works also but it is lossy.


Photoshop

  1. Slice it
  2. Save for web
  3. Uncheck Transparency

Faced same issue, Try using JPG format !! What worked for me here was using a jpg file instead of PNG as jpg files don't use alpha or transparency features. I did it via online image converter or you can also open the image in preview and then File->Export and uncheck alpha as option to save the image and use this image.


You can export to PNG without alpha in Preview. Simply open your image, choose export, select PNG, uncheck Alpha, and click Save. Preview also support batch export if you open all your images at once.


I've found you can also just re-export the png's in Preview, but uncheck the Alpha checkbox when saving.

enter image description here


You must remove alpha channels when uploading a photo to iTunes Connect.

You can do this by Preview, Photos App (old iPhoto), Pixelmator, Adobe Photoshop and GIMP.

Preview

  1. Open the photo in Preview (if the photo is in your photo album in Photos app (the old iPhoto), then simply drag it from the album to desktop. Then control-click (right-click when mouse) the duplicated photo and select Preview.app under Open With menu).

  2. Select Export… under File menu, and after selecting the destination, uncheck Alpha at the bottom, and click Export.

    File ==> Export...

    Alpha

Pixelmator

  1. Open the image in Pixelmator, without creating a new Pixelmator file. Just drag the photo to the Pixelmator window.

  2. From Share menu, click Export for Web…

    PM

  3. In the top bar, deselect Transparency.

  4. Click Next and then save the new file somewhere.

Finally, upload the new photo to iTunes Connect.

GIMP

  1. Open the photo in GIMP.

  2. Open the Layer menu.

  3. Under Transparency, click Remove Alpha Channel.

  4. Save the photo.

Adobe Photoshop

  1. Open the photo in Adobe Photoshop.

  2. Under Layer menu, click Layer Mask and then From Transparency.

  3. Delete the layer mask by right-clicking on the mask in the Layer panel and selecting Delete Layer Mask.


Extending Roman B. answer. This is still a problem, I was uploading a cordova app. my solution using mogrify:

brew install imagemagick
* navigate to `platforms/ios/<your_app_name>/Images.xcassets/AppIcon.appiconset`*
mogrify -alpha off *.png

Then archived and validated successfully.


You can simply create a new Photoshop document and set its default background to White instead of Transparent. Then, copy and paste your image to the newly created document and save it.


Still a problem in 2019 :=)

This worked for me: Select all images you want to upload -> Right click -> Open in Preview -> Export -> Uncheck alpha -> Use the exported images.


i have same problem just compress your png file on https://tinypng.com/ online and then try to upload that new compressed png file.

its work for me.


Exporting from Sketch

To avoid transparency, ensure no layer extends beyond the artboard bounds.


You can remove the alpha channel from a PNG file from the command line with pngcrush, using the flag "-c 2":

$ file input.png
input.png: PNG image data, 1024 x 1024, 8-bit/color RGBA, non-interlaced
$ pngcrush -q -c 2 input.png output.png
libpng warning: iCCP: known incorrect sRGB profile
$ file output.png
output.png: PNG image data, 1024 x 1024, 8-bit/color RGB, non-interlaced

Note the change from RGBA to RGB: the Alpha channel is gone!

pngcrush lives at http://pmt.sourceforge.net/pngcrush/


i was able to use imageoptim to remove alpha channel and compress png files.


If you have imagemagick installed, then you can put the following alias into your .bash_profile. It will convert every png in a directory to a jpg, which automatically removes the alpha. You can use the resulting jpg files as your screen shots.

alias pngToJpg='for i in *.png; do convert $i ${i/.png/}.jpg; done'

Use mogrify tool from ImageMagick package to remove alpha channel.

brew install imagemagick
cd folder_with_images
mogrify -alpha off */*.png

Update from May 3

You can tell whether image contains alpha channel by running:

sips -g all image.png

In case you render screenshots in iOS Simulator you can drop alpha channel by passing BOOL opaque = YES to UIGraphicsBeginImageContextWithOptions:

UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0); 

What worked for me here was using a jpg file instead of PNG as jpg files don't use alpha or transparency features. I did it via online image converter or you can also open the image in preview and then File->Export and uncheck alpha as option to save the image and use this image.


If you are using Photoshop go File > Save for web (Command + Option + Shift + S). Make sure the Transparency is unchecked and this should work.


Faced same issue, Try using JPG format !!


On Pixelmator you can use 'Share > Export for Web...' (? + ? + E)

enter image description here

and deselect Transparency in the Tool Options Bar.

enter image description here


Convert your PNG image to JPEG format.


For this i made a new simple tool. You can remove alpha channel (transparency) of multiple .png files within seconds.

Alpha Channel Remover

You can download from here http://alphachannelremover.blogspot.com


it so easy...

Open image in Preview app click File -> Export and uncheck alpha


Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to iphone

Detect if the device is iPhone X Xcode 8 shows error that provisioning profile doesn't include signing certificate Access files in /var/mobile/Containers/Data/Application without jailbreaking iPhone Certificate has either expired or has been revoked Missing Compliance in Status when I add built for internal testing in Test Flight.How to solve? cordova run with ios error .. Error code 65 for command: xcodebuild with args: "Could not find Developer Disk Image" Reason: no suitable image found iPad Multitasking support requires these orientations How to insert new cell into UITableView in Swift

Examples related to itunes

Install IPA with iTunes 12 Images can't contain alpha channels or transparencies Application Loader stuck at "Authenticating with the iTunes store" when uploading an iOS app Is there a way since (iOS 7's release) to get the UDID without using iTunes on a PC/Mac? 'Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format' Install IPA with iTunes 11 How to fix itunes could not connect to the iphone because an invalid response was received from the device? A server with the specified hostname could not be found How to install a .ipa file into my iPhone? How can I pass an argument to a PowerShell script?

Examples related to app-store-connect

Error ITMS-90717: "Invalid App Store Icon" Missing Compliance in Status when I add built for internal testing in Test Flight.How to solve? ITSAppUsesNonExemptEncryption export compliance while internal testing? This action could not be completed. Try Again (-22421) Xcode 7 error: "Missing iOS Distribution signing identity for ..." No suitable records were found verify your bundle identifier is correct My prerelease app has been "processing" for over a week in iTunes Connect, what gives? Build not visible in itunes connect How to remove a build from itunes connect? iTunes Connect Screenshots Sizes for all iOS (iPhone/iPad/Apple Watch) devices