How big should a Firefox toolbar button be? - firefox

What size, in pixels, should a custom Firefox toolbar button icon be?
I've seen quite a variety. Most commonly I've come across 32x32, 24x24 and 16x16 but also 10x10, 15x15, 16x14, etc. I cannot find a definitive reference.
Also see: How big should an Internet Explorer icon be?

Not sure how I found it, but the Creating toolbar buttons article at the Mozilla Developer Center defines Firefox big icon size as 24x24 and small icon size as 16x16.

There is no definitive size given.
The size of icon will depend on whether the user has large/small icons enabled. 32x32 is generally a good mid-point.

Related

Finder toolbar icons are jagged or anti-aliased on non-retina displays

I'm trying to create Finder toolbar icons that match the look and feel of Monterey, but they seem to be jagged as if there are issues with anti-aliasing.
Here are the retina icons I'm trying to convert (two on the right):
And here is how they look on my non-retina display:
At first, I thought this was simply a problem with automatic anti-aliasing. However, when I manually resize the icons to 32x32, this is how they're supposed to look:
But when I use those icons in Finder, they look jagged all over again. I have no idea what is happening.
Update
Steps to reproduce:
Take icon_terminal_light.icns from this icon pack
If you already have a custom Finder toolbar icon, skip to step 6
Right-click on your Finder toolbar and choose "Customize Toolbar"
Click-and-drag any application onto the toolbar
Click "Done"
Right-click on your application and choose "Get Info"
Click-and-drag icon_terminal_light.icns onto the icon in the upper-left
Notice:
If you move the Finder toolbar to a non-retina screen, the icon will look thin and the edges will be jagged.
You can even open icon_terminal_light.icns in Preview, resize it to 32x32, and then export it to a new icns file. The icns file will look smooth on a non-retina monitor, but if you try putting it into the toolbar, it'll be jagged once again.
Finder has a quirk whereby the alpha layers of toolbar icons get multiplied by two when the window is active. If the Finder window is in the background, however, the icons probably look how'd you expect.
If your icons have any thin graphical element, the anti-aliased pixels will have low alpha values. When those alpha values are doubled, the pixels practically disappear, which is what looks like is happening.
I solved this issue when trying to resize the icons provided in OpenInTerminal-Light. My solution is a bit of a hack:
To fix the rendering, I manually resized the icons and added 89% gray behind the anti-aliased pixels. Every pixel has either 0% or 100% alpha now.
You can see more detailed notes in the issue I opened on GitHub.

How to strech Visual assets in UWP?

I have generated the assets for my uwp app using the Assets Generator (which is inside the Package.appxmanifest) and also using this extention.
It generates files OK. However when i see the icons, they are centered. Like (the icon on the right of Settings) where you can barely see anything. The quality of the icon is better than it is showed here, and the quality of the icon is good. So the problem is that the icon is centered in the rectangle. I want it to stretch over all its rectangle.
Like:. (it does not need to stretch to 2 rectangles as in this photo.)
How can i do this?
Edit: Perhaps the question was not clear. I want to remove the padding from the icon. Let me give you another example that may be more clear. In the taskbar.
I have my logo here, with padding outside. I want it to stretch so there is no padding.I want my logo to be the size of the actual container.
Stretching the icon to 2 rectangles has nothing to do with the developer. You as a developer do not have any control over that. The user can right click the tiles and select the size of the tile, if they select it to be medium size, it will take space of 2 rectangles if small then only 1 and if large size is selected it take size of 4 rectangles.
In the image below you can see I have opened the context menu on the SMicrosoft Store tile and its selected size is currently Wide which is why it is currently taking 2 squares ( or rectangles ) and I can change its size to small, Medium or Large as well, this is all done at the user end after they have installed your app.
If you want to remove extra padding around your assets: when you generate assets with the built in asset generator of the manifest there is a checkbox "add recommended padding" uncheck it and you will have the desired result.

NSToolbarItem with Segmented Control - Images Not Rendering Correctly

I'm trying to emulate Xcode's toolbar controls to show/hide the Navigator and Inspector:
...but without the bottom pane (only left and right: two segments)
I screen-captured the icons from Xcode's UI and traced them in an image editing application. The resources for the left pane are:
#1x:
(20x20 #72 dpi)
#2x:
(40x40 #72 dpi, although using 20x20 #144 dpi seems to make no difference)
The right-pane counterparts are identical, but flipped horizontally.
All rhe resources are stored in the asset catalogue, as follows:
I dropped a segmented control on the toolbar, to create a toolbar item with a segmented control inside it, and set the image attribute for each segment (0 and 1).
Image Scaling for both segments is set to "Proportionally Down". The segment control has segment width "Fixed" checked, with a width of 48 for both segments. The toolbar item has Minimum Size of (83 x 25) and Maximum Size of (100 x 28).
The icons display correctly on the storyboard (Interface Builder).
However, when I run the app, I can not get the icon images to display appropriately.
If I launch my app on a retina monitor, no icon is displayed on either segment.
If I move the window to the external, non-retina monitor, both icons are displayed.
If I remove the one of the two image sets from thew catalogue and run the app, the other icon is correctly displayed! (on either monitor)
If I further set the same, remaining image for both segments, they display correctly!
If I leave both image sets in the project, but reset the Image field in one of the segments to empty, the other icon isn't displayed eihter!
What on Earth is going on??
I have put a sample project on GitHub that reproduces the issue.
Edit: Just to make sure, I extracted the resources from the compiled app binary using the cartool command line utility (as explained in this answer), and all 4 images are there at the right sizes...
Solution: As suggested by Ivan's answer below, I switched to using vector graphics (PDF) for the icons. I downloaded the trial version of Acorn and recreated my icons at 1x size, then exported as PDF.
To avoid blurring at the scaled up size of #2x at runtime, I had to make sure all coordinates in the editor were integers, and also check the box for "Snap to pixels" in the Vector Shapes inspector for each shape layer:
(Happy Ending)
$ git commit -m "Fix toolbar icons for good (PDF)"
According to my experience, using of bitmaps in toolbar is troublesome. You can try to target exactly recommended resolutions to possibly avoid some problems: https://developer.apple.com/macos/human-interface-guidelines/icons-and-images/custom-icons/
However, the cleanest way would be to use vector (pdf) icons, as they simply work as intended.

Firefox Addon manager blurry icons

I created an extension for Firefox and made a simple icon for it.
But when I tested it in the Addon manager the icon appeared blurry despite my source image was fine.
I started to experiment with different sizes and shapes of the icon.
Figured out that the icon container is 48x48 pixels and the default addon icon is 32x32.
But for any experiments the result was the same.
So I created a simple rectangle icon drawing it by pixels so it shouldn't blur anyway:
But the result blurred again:
There is some sub-pixels around the rectangle though the border should be crisp...
In pixels view:
Also I found the default extension icon (a puzzle piece) and in pixels it looks perfect but in the manager the borders are blurred a little though it's not obvious at first glance.
Are you sure this is not happening when you save the image? I don't know what app you are using, but many photo apps try to compress jpm images when you save them by default. Check this first.
Usually this does not happen with png images, so you could try using a png image instead as well.
It was silly enough... The broblem was the page scale not 100% on the Addons page. Pressed Ctrl+0 and all restored.
It happens sometimes on other web pages when I zoom in/out the view and images lose their sharpness.

OSX NSStatusBar statusbar icon dimensions?

I couldn't find a document or hint which dimensions a statusbar or menubar icon in OSX should have. I found out that such an icon has 18x18 pixel for normal displays, but how to do that for retina displays? Is it 36x36 and are the usually naming coventions ...#2 working in this case?
The official apple docs covers informations of all other icon sizes, but nothing about a status bar icon.
From the docs:
When you create an icon to put inside a toolbar control in PDF format,
OS X will automatically scale your icon for high-resolution display.
You do not need to provide a high-resolution version.
there is no #2X version.
For freestanding icons in a toolbar, create inviting images that are
easy to identify. Because freestanding toolbar icons do not need to
fit within a toolbar control, you have a little more room to express
them. As you design a freestanding icon for your toolbar, follow these
guidelines:
Use a straight-on perspective. Make the outline sharp and clear. Use
anti-aliasing. Use color judiciously to add meaning. Create icons for
standard- and high-resolution displays. You need to supply two
resources: 32x32 and 32x32#2x. See Table 5-1 for the corresponding
canvas sizes. Use the PNG format.
For reference

Resources