255

I have a Windows application which will run in Windows XP and newer (i.e. Vista/7). According to the Vista UI Guidelines, the standard sizes are 16x16, 32x32, 48x48, 256x256 (XP standard sizes do not include the 256x256 icon). In addition to those sizes, I also have 96x96 and 128x128 (and could create more).

Which of these icon sizes should I include? Will the shell actually use the "non-standard" sizes, or will I simply bloat my application?

1

9 Answers 9

316

I took some time to check it in detail. I created an icon whose images have sizes of 16, 24, 32, 40, 48, 64, 96, 128 and 256. Then I checked which image is shown. All these were done with normal 96dpi. If using a larger DPI, the larger sizes may be used (only checked this a bit in Windows 7). The results:

Windows XP:

  • Explorer views:
    • Details / List: 16
    • Icons: 32
    • Tiles / Thumbnails: 48
  • Right-click->Properties / choosing a new icon: 32
  • Quickstart area: 16
  • Desktop: 32

Windows 7:

  • Explorer views:
    • Details / List / Small symbols: 16
    • All other options: 256 (resized, if necessary)
  • Right-click->Properties / choosing a new icon: 32
  • Pinned to taskbar: 32
    • Right-click-menu: 16
  • Desktop:
    • Small symbols: 32
    • Medium symbols: 48
    • Large symbols: 256 (resized, if necessary)
    • Zooming using Ctrl+Mouse wheel: 16, 32, 48, 256

Windows Runtime: (from here)

  • Main tile: 150x150, 310x150 (wide version)
  • Small logo: 30x30
  • Badge (for lockscreen): 24x24, monochromatic
  • Splashscreen: 620x300
  • Store: 50x50

So the result: Windows XP uses 16, 32, 48-size icons, while Windows 7 (and presumably also Vista) also uses 256-size icons. All other intermediate icon sizes are ignored (they may be used in some area which I didn't check).


I also checked in Windows 7 what happens if icon sizes are missing:

The missing sizes are generated (obviously). With sizes of 16, 32, and 48, if one is missing, downscaling is preferred. So if we have icons with size 16 and 48, the 32 icon is created from the 48 icon. The 256 icon is only used for these if no other sizes are available! So if the icons are size 16 and 256, the other sizes are upscaled from the 16 icon!

Additionally, if the 256 icon is not there, the (possibly generated) 48 icon is used, but not resized anymore. So we have a (possibly large) empty area with the 48 icon in the middle.

Note that the default desktop icon size in XP was 32x32, while in Windows 7 it is 48x48. As a consequence, for Windows 7 it is relatively important to have a 48 icon. Otherwise, it is upscaled from a smaller icon, which may look quite ugly.


Just a note about Windows XP compatibility: If you reuse the icon as window icon, then note that this can crash your application if you use a compressed 256 icon. The solution is to either not compress the icon or create a second version without the (compressed) 256 icon. See here for more info.

10
  • 12
    Well, here it says 64px is also required, and on the official icon guidelines it says 20px, 24px and 40px are also recommended. The 40px icon seems to be used in alt+tab and baloons, others seem to be used depending on DPI (e.g., 20px being used instead of 16px in a higher-DPI screen, otherwise scaled down from the bigger 32px size, which may look even uglier). Haven't tested. Commented Jan 10, 2012 at 22:52
  • 2
    I did some more testing. For display on the desktop, when I set it to 144dpi ("150%") on Windows 7, for the smallest possible icon it used the 24px icon (if it is there, otherwise uprezzed 16px). From the icon guidelines, it seems there is a "Classic Mode" on Vista which also uses the 64px icon. However, Windows 7 does not use it. Rather, only the 256px icon is resized. Commented Jan 11, 2012 at 9:21
  • Interesting, thanks for the finds. In any case, I don't know how many applications in the wild have more than 16, 32, 48 and (hopefully) 256 px icons. I'd guess very few. But maybe users would notice, because one icon between the rest is crispier. Commented Jan 11, 2012 at 9:47
  • 3
    And it's missing half of the time if the application is an utility and not very popular software, or old... Even some of Visual Studio's icons (those for filetypes) don't even have 48px versions. Commented Jan 11, 2012 at 10:27
  • 2
    An update for Windows 10 would be great. It seems that at 96 DPI the icons are 24x24, but Windows 10 also supports higher DPI settings. Commented Sep 22, 2016 at 12:37
30

After some testing with an icon with 8, 16, 20, 24, 32, 40, 48, 64, 96, 128 and 256 pixels (256 in PNG) in Windows 7:

  • At 100% resolution: Explorer uses 16, 40, 48, and 256. Windows Photo Viewer uses 96. Paint uses 256.
  • At 125% resolution: Explorer uses 20, 40, and 256. Windows Photo Viewer uses 96. Paint uses 256.
  • At 150% resolution: Explorer uses 24, 48, and 256. Windows Photo Viewer uses 96. Paint uses 256.
  • At 200% resolution: Explorer uses 40, 64, 96, and 256. Windows Photo Viewer uses 128. Paint uses 256.

So 8, 32 were never used (it's strange to me for 32) and 128 only by Windows Photo Viewer with a very high dpi screen, i.e. almot never used.

It means your icon should at least provide 16, 48 and 256 for Windows 7. For supporting newer screens with high resolutions, you should provide 16, 20, 24, 40, 48, 64, 96, and 256. For Windows 7, all pictures can be compressed using PNG but for backward compatibility with Windows XP, 16 to 48 should not be compressed.

3
  • See my answer here (stackoverflow.com/questions/12385143/…) but if you compress the 256x256 image in the .ico file ... Windows XP systems will have trouble opening the file. You will get a FileFormatException with HRESULT 0x88982F07.
    – cplotts
    Commented Nov 14, 2013 at 18:10
  • 1
    It's also worth to mention those high DPI versions need to be saved in 24bpp mode, I've tried to store them in 8 bit color mode and Windows 7 used 256px version instead of 20x20px in 125% DPI. Commented Mar 29, 2016 at 12:24
  • 2
    This is simple, but exhaustive. Very important to take DPI into consideration.
    – caesay
    Commented Jun 22, 2016 at 23:18
25

The Microsoft UX icon guideline says:

"Application icons and Control Panel items: The full set includes 16x16, 32x32, 48x48, and 256x256 (code scales between 32 and 256)."

To me this implies (but does not explicitly state, unfortunately) that you should supply those 4 sizes.

Additional details regarding color formats, which you may also find useful:

  • "Icon files require 8-bit and 4-bit palette versions as well, to support the default setting in a remote desktop."

  • "Only a 32-bit copy of the 256x256 pixel image should be included, and only the 256x256 pixel image should be compressed [as PNG] to keep the file size down."

0
16

In the case of Windows 10 this is not exactly accurate, in fact none of the answers on stackoverflow was, I found this out when I tried to use pixel art as an icon and it got rescaled when it was not supposed to(it was easy to see in this case cause of the interpolation and smoothing windows does) even thou I used the sizes from this post.

So I made an app and did the work on all DPI settings, see it here:
Windows 10 all icon resolutions on all DPI settings
You can also use my app to create icons, also with nearest neighbor interpolation with smoothing off, which is not done with any of the bad editors I have seen.

If you only want the resolutions:
16, 20, 24, 28, 30, 31, 32, 40, 42, 47, 48, 56, 60, 63, 84, 256
and you should use all PNG icons and anything you put in beside these it won't be displayed. See my post why.

1
  • Sorry, did you mean 64? Your post has 84, which isn't mentioned anywhere else, but doesn't mention 64, which seems to be one of the default sizes.
    – user4551
    Commented Aug 25, 2020 at 11:46
12

(Updated answer for Windows 8/10)

View full list of guidelines and sizes here, in new Windows design guidelines: https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-app-assets#asset-types

Still include .ICO file with these sizes to support legacy experiences:

  • 16x16
  • 24x24
  • 32x32
  • 48x48
  • 256x256
1
  • No size list in that page.
    – huang
    Commented Jan 22, 2021 at 17:51
8

Not 96x96, use 64x64 instead. I usually use:

  • 16 - status/titlebar button
  • 32 - desktop icon
  • 48 - folder view
  • 64/128 - Additional sizes

256 works as well on XP, however, old resource compilers sometimes complained about "out of memory" errors.

2
  • I have seen you have dealt with Java before. How can I implement such behavior with Java? The problem is that the icon shown in the system task bar is much bigger compare to the icon in the title bar and they cannot be re-sized properly by the system. The most I can do is stage.getIcons().add(image); but it won't let me specify what size and where it belongs to for example the task-bar, folder-view or any else. I'm using JavaFX 8
    – homerun
    Commented Apr 20, 2017 at 10:21
  • 1
    @someFolk java compiles to "class" files or a "jar" file (which is a zip of class files + manifest). In other words, it does not compile to PE (windows executables). However, there are tools that build wrappers for you - basically small programs that contain the jar as a resource (which is extract and ran when the program is run). The answer here mentions a few of them What this means is that your problem depends on the program you use. However, there are tools for editing resources (eg: Resource Hacker)
    – Christian
    Commented Apr 20, 2017 at 21:17
8

This official Microsoft guide says:

Apps should have, at the bare minimum: 16x16, 24x24, 32x32, 48x48, and 256x256.

Here is a list of some programs and the sizes they have included in their ICO file:

Application Icon 16 20 24 32 40 48 60 64 72 80 96 256
Google Chrome 106
IntelliJ IDEA 2022.2.3
MS PowerToys 0.63.0
MS Paint 11.2208.6.0
MS Task Manager 10.0
MS Word 2021
MS Visual Studio 2022

We can create an ICO file with various sizes from a PNG etc. with ImageMagick like this:

./magick my-source-image.png -background transparent -define icon:auto-resize="16,24,32,48,64,256" C:/Users/Hello/Desktop/result.ico

Notes

  1. No app has included the 128 size
  2. The 256 size is PNG format; others are ICO
  3. MS is short for Microsoft
  4. The icons were extracted from program .exe files with this tool
  5. You can save the above icons and inspect them for yourself with ImageMagick like so:
    ./magick identify "C:/Users/Hello/Desktop/result.ico"
    
2

From Microsoft MSDN recommendations:

Application icons and Control Panel items: The full set includes 16x16, 32x32, 48x48, and 256x256 (code scales between 32 and 256). The .ico file format is required. For Classic Mode, the full set is 16x16, 24x24, 32x32, 48x48 and 64x64.

So we have already standard recommended sizes of:

  • 16 x 16,
  • 24 x 24,
  • 32 x 32,
  • 48 x 48,
  • 64 x 64,
  • 256 x 256.

If we would like to support high DPI settings, the complete list will include the following sizes as well:

  • 20 x 20,
  • 30 x 30,
  • 36 x 36,
  • 40 x 40,
  • 60 x 60,
  • 72 x 72,
  • 80 x 80,
  • 96 x 96,
  • 128 x 128,
  • 320 x 320,
  • 384 x 384,
  • 512 x 512.
1

TL;DR. In Visual Studio 2019, when you add an Icon resource to a Win32 (desktop) application you get an auto-generated icon file that has the formats below. I assume that the #1 developer tool for Windows does this right. Thus, a Windows compatible should have the following formats:

| Resolution | Color depth | Format |
|:-----------|------------:|:------:|
| 256x256    |      32-bit |  PNG   |
| 64x64      |      32-bit |  BMP   |
| 48x48      |      32-bit |  BMP   |
| 32x32      |      32-bit |  BMP   |
| 16x16      |      32-bit |  BMP   |
| 48x48      |       8-bit |  BMP   |
| 32x32      |       8-bit |  BMP   |
| 16x16      |       8-bit |  BMP   |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.