Use Photoshop to create an iOS tabbar icon

Source: Internet
Author: User

IOS apps use tab bars and usually we want to create our own icons. however, creating icons for the tab bar is not as simple as drawing a pretty icon in Photoshop and saving it as PNG due to the way IOS renders tab bar icons.

Read this brief tutorial to learn how to make Tab bar icons...

The thing about tab bar icons is that IOS does not care what color the pixels are. The onlything that is considered when rendering a tab bar icon
Is the pixels 'transparency (or alpha value or opacity ).
It does not matter if a given pixel is white, red, black or mauve. if the pixel is solid, non-transparent it will be rendered as solid white (yes, even if the pixel is black ). (Well, Gray actually, but we'll call it white ). if the pixel is completely transparent
It will be rendered as black. and if the pixel is somewhere in between transparent and solid it will be rendered as gray. 50% transparent corresponds to 50% gray. 10% transparent (90% opaque) is 90% white.

When the tab is selected, the icon is rendered as blue (a blue gradient, actually) instead of white.

The size is fixed at 30x30 pixels. And thus 60x60 pixels for the retina version.

So how to make icons like that? By following this simple tutorial.
The tutorial assumes that you are using Photoshop and are fairly familiar with working with layers and stuff.

1. Create a New Photoshop document. 60x60 pixels, RGB mode with transparent background. This is for the retina resolution image.

2. Select All and fill with solid white color.

3. Add a layer mask

4. Show the channels list, select the mask channel and hide all other channels.
The mask channel is where all drawing will take place!

5. Start
By filling the channel with solid black
Now draw your icon. Using grayscale colors only! You cannot use colors other than white, black and grays. (indeed, you can not even select any other
Color since you are drawing in the mask channel .)

In this example I have drawn using both Photoshop tools (penpencil and marquee) and by copying a shape from illustrator and pasting it into Photoshop (make sure the mask channel is still active) as a path which I then filled with White:

If you switch back to viewing RGB channels (click the white square in the layers list) it will look like this:

7. Export
The image as PNG: choose file-> Save for Web & devices. choose PNG-24 with transparency. remember to append "@ 2x" to the file name since this is the retina resolution image. (E. g. export tab_image@2x.png ".)

8. Now create the normal resolution image. This image must be 30x30 pixels. The easiest way is to save for Web & devices again but scale to 50% (30x30) first:

Give it the same name but without the "@ 2x" (I. e. Alibaba tab_image.png "if using the filename above ).

This was the easy way of making the lo-res image. But the much better way of doing it wocould be something like this:

  1. Scale the image (image-> image size ...) To 50%
  2. Save the document as a new file (file-> Save ...) So you have one file for the retina version and one file the normal version
  3. Adjust the image by hand so it is still pixel-perfect since the automatic scaling usually creates imperfections. See this example of how the scaled-down image looks.
    This is not quite what we want (we want solid boxes and black lines between them ):


And you're done

Here is what the final result looks like in the app. First in normal resolution:
 

And retina version:
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.