I started using the ionicons_2-0-1_ios-pause-outline and
to convert these to the correct size.
However when I try the iOS iPhone 7 simulator I get this message:
Warning: Input PNG does not have an 8 bit input depth. Please convert your PNG to 8-bit for optimal performance on iPhone OS
How can I convert icons to png with the correct depth?
4 Answers
Answers 1
Your images are not in 8-bit, images need to be in 8-bit, not 16-bit. That goes for the icon as well. and iOS only supports 8-bit images as well.
8-bit means 8-bits per color channel, which is 16.7 million colors.
16 bits per channel give 32,769 colors per channel, which is actually 281 trillion possible colors! 16-bit is only used for photo editing, images still need to be saved back down to 8-bit for printing.
MakeAppIcon is useful website for generating App icons. and IcoFX is a fantastic tool for creating 8-bit depth icon.
Answers 2
The main difference between an 8 bit image and a 16 bit image is the amount of tones available for a given color. So your image has too many colors in it. Here's a list of some applications that can solve this problem for you. http://myappmag.com/make-windows-icons/ from that list; Number 5 seems to be a good option.
Also this can help you find a color within the 8-bit range. http://neildowning.com/HEX_to_RGB_color_converter.php
Answers 3
How can I convert icons to png with the correct depth?
Convert to jpg and back to png. That will also remove the alpha (transparency) channel.
Answers 4
Looks like Xamarin requires 8-bit per color channel
(8-bit for Red, 8-bit for Green, and 8-bit for Blue)
http://forums.gamesalad.com/discussion/comment/61399/#Comment_61399
That is called "true color" which is actually PNG-24 (because 24 = 8*3)
https://en.wikipedia.org/wiki/Color_depth#True_color_.2824-bit.29
So why don't we run a python script to do that for us. If you are not familiar with python, all you need to do is
- Download Python (make sure you add pip to your path during setup)
- run
pip install pillow
in the cmd (Run as Administrator if saysAccess is denied
) . Pillow is an imaging library for python. - Make a file in the folder with your images, call it
convert.py
Put the following in it
def convert_to_24(image_file): from PIL import Image try: im = Image.open(image_file) except(FileNotFoundError): print(image_file ,"was not found.") return print(image_file,"is in",im.mode,"mode.") if im.mode != "RGB": im = im.convert("RGB") im.save(image_file.split('.')[0]+"_24.png") return if __name__ == "__main__": convert_to_24(input('Enter image file name:'))
Open cmd where the script and the images are and type
python convert.py
When it asks for the file name, put the file name including the extension, like
filename.png
It will tell you in what mode the image was, and will create another image with a name filename_24.png
that has 8-bit color pixels (aka 24bit png).
0 comments:
Post a Comment