非视网膜显示屏上的 Finder 工具栏图标呈锯齿状或消除锯齿

发布于 2025-01-12 20:31:58 字数 1337 浏览 3 评论 0原文

我正在尝试创建与 Monterey 的外观和感觉相匹配的 Finder 工具栏图标,但它们似乎呈锯齿状,好像存在抗锯齿问题。

以下是我尝试转换的视网膜图标(右侧两个):

视网膜中的 Finder 工具栏

以下是它们在我的非视网膜显示屏上的外观:

非 Finder 工具栏-retina display

起初,我以为这只是自动抗锯齿的问题。但是,当我手动将图标大小调整为 32x32 时,它们应该是这样的:

Finder 工具栏所需的外观

但是当我在 Finder 中使用这些图标时,它们看起来又是锯齿状的。我不知道发生了什么事。

更新

重现步骤:

  1. 此图标包
  2. 如果您已有自定义 Finder 工具栏图标,请跳到步骤 6
  3. 右键单击​​ Finder 工具栏,然后选择“自定义” 单击“工具栏”
  4. ,将任何应用程序拖动到工具栏上
  5. 单击“完成”
  6. 右键单击​​您的应用程序,然后选择“获取信息”
  7. 单击 icon_terminal_light.icns 并将其拖动到上方的图标上注意

如果将 Finder 工具栏移动到非视网膜屏幕,图标会显得很细,而且边缘会呈锯齿状。

您甚至可以在预览中打开 icon_terminal_light.icns,将其大小调整为 32x32,然后将其导出到新的 icns 文件。 icns 文件在非视网膜显示器上看起来会很平滑,但如果您尝试将其放入工具栏中,它会再次出现锯齿状。

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):

Finder toolbar in retina

And here is how they look on my non-retina display:

Finder toolbar on 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:

Finder toolbar desired appearance

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:

  1. Take icon_terminal_light.icns from this icon pack
  2. If you already have a custom Finder toolbar icon, skip to step 6
  3. Right-click on your Finder toolbar and choose "Customize Toolbar"
  4. Click-and-drag any application onto the toolbar
  5. Click "Done"
  6. Right-click on your application and choose "Get Info"
  7. 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一笑百媚生 2025-01-19 20:31:59

Finder 有一个怪癖,当窗口处于活动状态时,工具栏图标的 Alpha 层会乘以 2。但是,如果 Finder 窗口位于背景中,则图标可能看起来如您所期望的那样。

如果您的图标具有任何较薄的图形元素,则抗锯齿​​像素的 Alpha 值将会较低。当这些 alpha 值加倍时,像素几乎消失,这就是看起来正在发生的事情。

我在尝试调整 OpenInTerminal-Light。我的解决方案有点黑客:

为了修复渲染问题,我手动调整了图标大小,并在抗锯齿像素后面添加了 89% 的灰色。现在每个像素都有 0% 或 100% Alpha。

您可以在我在 GitHub 上打开的问题中查看更详细的注释。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文