Images can't contain alpha channels or transparencies - ios

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

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

AFAIK png with transparency is not allowed. use jpg OR update your png (photoshop or whatever you using to create the png) and delete the transparency areas. if you work with shadows, use jpg, that will do no headaches.

it's so easy...
Open image in Preview app click File -> Export and
uncheck alpha

For this i made a new simple tool. You can remove alpha channel (transparency) of multiple .png files within seconds.
You can download from here http://alphachannelremover.blogspot.com

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

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
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).
Select Export… under File menu, and after selecting the destination, uncheck Alpha at the bottom, and click Export.
Pixelmator
Open the image in Pixelmator, without creating a new Pixelmator file. Just drag the photo to the Pixelmator window.
From Share menu, click Export for Web…
In the top bar, deselect Transparency.
Click Next and then save the new file somewhere.
Finally, upload the new photo to iTunes Connect.
GIMP
Open the photo in GIMP.
Open the Layer menu.
Under Transparency, click Remove Alpha Channel.
Save the photo.
Adobe Photoshop
Open the photo in Adobe Photoshop.
Under Layer menu, click Layer Mask and then From Transparency.
Delete the layer mask by right-clicking on the mask in the Layer panel and selecting Delete Layer Mask.

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

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.

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. 👍

On Pixelmator you can use 'Share > Export for Web...' (⇧ + ⌘ + E)
and deselect Transparency in the Tool Options Bar.

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.

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/

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.

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.

Faced same issue, Try using JPG format !!

Photoshop
Slice it
Save for web
Uncheck Transparency

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.

On Windows 10 you can use Paint 3D.
Open the image
Choose "Canvas" in the top menu
De-select the "Transparent canvas" checkbox in the right panel
Save

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'

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 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.

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

Convert your PNG image to JPEG format.

Related

Xcode 8.3.3 won't accept AppIcon

When i try to drop PNG images for AppIcon in Assets.xcassets,
Placeholder: iPhoneApp iOS 7-10 60pt
Xcode does not accept these images. Images are PNG of right size 120x120(60x60#2x) and 180x180(60x60#3x), respectively.
If you have any suggestion please help.
According to the documentation, three parameters are important for the App Icon:
Format: all icon images must be in PNG format. Icon images may include an alpha channel but should not include any transparent regions.
The size: Here the base size is 60*60, so 120*120#2x and 180*180#3x.
Color model: It should be RGB.
You can check all these values with the Preview Inspector. In your case, the background of your icon is not visible in your screenshot (white or transparent?) so I would check for the transparency.
Also, I would double check the size. Some image editors tend to round the values and add 1px on one of the dimensions.
I resolved this.
Problem was that my files, although PNG images, did not have .png extension in file name. XCode did not recognize image format without extension, and did not show any warning.
After adding extension, everything start working properly.

ImageMagick command to strip ICC color profiles

I have ~500 images that all seem to have a color profile on them; as when I upload to Shopify it changes the color tone of the images. This is due to Shopify stripping out the color profile on upload as per this link:
https://help.shopify.com/themes/customization/colors-images-and-video/fix-colors-of-uploaded-images
I have tried to use ImageMagick to strip out all the color profiles: mogrify +profile "-strip" *.jpg and this noticeably changes the image color which I can see on the image thumbnail but when I try uploading to Shopify the color is still being changed.
What am I doing wrong with ImageMagick? Or maybe it's not a color profile that needs removing?
I have also tried this on Photoshop using 'Save for Web', and this method strips out the color profile, but I don't want to do this for ~500 images, and File > Automate > Batch in CS6 doesn't have any Action for Save For Web. Can this be automated? I am running Windows.
Thanks
Original: http://imgur.com/3lcuZVy
Shopify: http://imgur.com/ko2bQvg
Photoshop: http://imgur.com/Ez3bNT4
EDIT:
I have run ImageMagick identity on the image 3 times. On the original image, on the image after upload to Shopify, and then 'save image as' and again after doing save for web on Photoshop
http://pastebin.com/710fHhJ0
Observations:
Original image: CMYK, ColorSeparation
Shopify image: sRGB, TrueColor
Photoshop image: sRGB, TrueColor
So after another ~hour of playing around I looked into Photoshop Automation. Turns out you can record your own macro and play it back. I wasn't aware you could record your own hence trying to play around with ImageMagick and this question.
For those who may stumble across this:
Window > Actions
[pops up on the toolbar]
Click the folded paper (New Action)
The record (circle) should now change to Red, it is recording.
Carry out your action, e.g mine was to go to File>Save for Web>click OK
Once finished your repetitive task, click the Stop button (square)
Now use your new recorded action, File > Automate > Batch
Unfortunately, this doesn't help those trying to do Save For Web using ImageMagick only.

Xcode generates png form pdf with different colors

We are following article to use pdf vector resources in iOS project: http://martiancraft.com/blog/2014/09/vector-images-xcode6/
However we faced problems. If we set color in Photoshop/Illustrator to #039AF0 then exported pdf will generate png with #1185ec color.
If we use old png way then colors are fine (please ignore pixelized image, the most important is color):
What can be the cause?
When a new artboard is created in Illustrator it defaults to using Adobe RGB for the color space which doesn't work well with iOS. To make sure the colors remain as close to the original as possible, set the color space to sRGB by selecting "Web" for Profile and RGB for Color Mode under Advanced.
This works well for new artboards. I have an Illustrator file as a deliverable that was created in Adobe RGB. For such cases, I've resorted to copy pasting vector paths on a new artboard that's set to sRGB before saving as PDF for use in Xcode 6.
I got the same problem, and finally I found that set the deployment Target to 7.0 or above solves the problem.
It is possible that Photoshop/Illustrator generates CMYK or other special colors in the PDF file and Xcode uses the PDF rendering engine that is implemented in iOS to convert the PDF files to PNG.
Because the iOS has problems with displaying CMYK colors, your PNG image has distorted colors.
The above is only an assumption because I have not seen a sample PDF file and the process used by Xcode to convert the PDF to PNG is not documented.

App icon displays a black square.

I am having my app icon be displayed as a black square instead of the intended image.
I have placed all of my AppIcons into the folder, Im wondering what could be causing this.
Your image needs to be an opaque PNG. No transparency or anything, as well as being the correct size.
If it already is that, try opening it in Preview and re-saving it as a PNG. That way OS X 'generated' it and it should be compatible. If that helps fix the issue, then your image editing program is saving in the wrong format...see info below.
Apple has this to say on generating PNGs:
For all images and icons, the PNG format is recommended. You should avoid using interlaced PNGs.
The standard bit depth for icons and images is 24 bits—that is, 8 bits each for red, green, and blue—plus an 8-bit alpha channel.
I have had this happen when the app is listed as a .png file, but the system is recognizing it as a .jpg or some other type ... find your icon in "finder" and open it with preview, go to the file menu select "export as" and make sure you choose PNG as the save format. Delete the old version in the application, delete the derived data, clean your project, and rebuild the application.

iTunes connect does not accept my large app icon

I have submitted a large app icon to iTunes Connect that meets all the specifications: .png file, 1024x1024 pixels, etc. and yet I still get the
error:
"The large app icon you uploaded is not valid. It must be a .jpeg, .jpg, .tif, .tiff, or .png file that is 1024 x 1024 pixels, at least 72 DPI, and in the RGB color space."
I created it using Photoshop Elements. Any guidance is greatly appreciated.
Update - problem solved:
I have tried it again. It worked. Did not need to se exported as PNG or TIF and I am not sure exactly what was different this time (after 4 hours of trying), but it uploaded.
The command below is a hack to base-line PNG images and format them "them
Apple way". Use the following in command line (Terminal), changing "/path/to/image/folder/" to match the location of your PNG files:
sips --deleteColorManagementProperties /path/to/image/folder/*.png
Notice the part about the RGB color space in the requirements. Maybe your file was saved as CMYK originally?
This error may occur if you changed the extension of image by changing name (forcefully from image.jpg to image.png) and you have not exported image to that format.
Simply exporting the image to that format will resolve your issue. You can use 512x512 or 1024x1024 RGB color space image with 72dpi.
Save it with "Not Interlaced" option cos I think it doesn't accept Interlaced PNGs
For those who have noscript or else active. Allow apple.com or otherwise you will just get "Your file could not be loaded. Try again." over and over again.
I had the same problem, tried a lot of different image sizes 1024, 512, jpg, png... First they were all in wrong CMYK color mode. Then I tried jpg with RGB, did not work
and FINALLY:
.PNG 1024x1024px with color mode "RGB" worked
Your Icon File has to be saved with the configuration below:
size 1024 x 1024 pixel with resolution max 72 dpi
your image / picture has no alpha colour (uncheck the alpha checklist)
no transparency, no rounded corner
save in PNG or JPEG format

Resources