46

This page explain 19*19 and 38*38. http://developer.chrome.com/extensions/browserAction.html#icon

But this page explain 16*16 and 48*48, 128*128. http://developer.chrome.com/extensions/manifest/icons.html

Which is correct?

gkalpak
  • 47,844
  • 8
  • 105
  • 118
hucuhy
  • 809
  • 3
  • 9
  • 15

4 Answers4

50

Both are correct ! They are for different sections/features:

The former refers to the browser-action icon (displayed on the top-right corner of your browser-window, next to the address bar). It is only displayed if your extension registers a browser-action.

The latter refers to icons used throughout the extension and browser, as is explained quite clearly in the link you provide:
(emphasis mine)

One or more icons that represent the extension, app, or theme. You should always provide a 128x128 icon; it's used during installation and by the Chrome Web Store. Extensions should also provide a 48x48 icon, which is used in the extensions management page (chrome://extensions). You can also specify a 16x16 icon to be used as the favicon for an extension's pages. The 16x16 icon is also displayed in the experimental extension infobar feature.


BTW, that second link mentions icon as the property name, which was replaced in Manifest v2 by default_icon.
("Migration to Manifest v2" guide)

gkalpak
  • 47,844
  • 8
  • 105
  • 118
  • did the spec change in this short period of time? i dont see 19 or 38 mentioned at all in the doc links provided by https://stackoverflow.com/users/2860966/hucuhy. – kinghat Mar 08 '19 at 18:10
  • It is not impossible. 5.5 years is not a short period of time :D – gkalpak Mar 08 '19 at 22:27
33

To elaborate on ExpertSystem's answer, here is an example manifest excerpt with all of the image sizes:

  "browser_action": {
    "default_icon": {
      "19": "images/icon19.png",
      "38": "images/icon38.png"
    },
    "default_popup": "popup.html"
  },
  "icons": { "16": "images/icon16.png",
           "48": "images/icon48.png",
          "128": "images/icon128.png" }, ...

Notice how the 19/38 icons are for the browser action, and the 16/48/128 are at the icons level.

I think it is best therefore to create the image as a vector graphic (e.g. svg file) and then save to a bitmap (e.g. png file) for each of the sizes.

Martin Capodici
  • 1,486
  • 23
  • 27
29

2020 Update:

I was researching this recently. Here is what I found:
These sizes seem to cover most scenarios: 16, 24, 32, 48, 128
These sizes seem to be outdated: 19, 38


Icons - Recommended Sizes:

16, 24, 32, 48, 128.

Size:   Manifest - Icons:   chrome.browserAction:

16      Yes                 Yes
24      No                  Yes
32      Yes                 Yes
48      Yes                 No
128     Yes                 No

Icons - Outdated Sizes:

19, 38.

Size:   Manifest - Icons:   chrome.browserAction:

19      No                  Outdated
38      No                  Outdated

theMaxx
  • 3,756
  • 2
  • 27
  • 33
3

For browser action, we just need a 16x16 icon now, as

The browser action icons in Chrome are 16 dips (device-independent pixels) wide and high.

Yang
  • 389
  • 2
  • 15