简体   繁体   English

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

[英]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.我正在尝试创建与 Monterey 的外观和感觉相匹配的 Finder 工具栏图标,但它们似乎参差不齐,好像存在抗锯齿问题。

Here are the retina icons I'm trying to convert (two on the right):这是我要转换的视网膜图标(右边两个):

视网膜中的 Finder 工具栏

And here is how they look on my non-retina display:这是他们在我的非视网膜显示器上的样子:

非视网膜显示屏上的 Finder 工具栏

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:但是,当我手动将图标调整为 32x32 时,它们应该是这样的:

Finder 工具栏所需的外观

But when I use those icons in Finder, they look jagged all over again.但是当我在 Finder 中使用这些图标时,它们看起来又是锯齿状的。 I have no idea what is happening.我不知道发生了什么。

Update更新

Steps to reproduce:重现步骤:

  1. Take icon_terminal_light.icns from this icon pack从此图标包中获取icon_terminal_light.icns
  2. If you already have a custom Finder toolbar icon, skip to step 6如果您已有自定义 Finder 工具栏图标,请跳至第 6 步
  3. Right-click on your Finder toolbar and choose "Customize Toolbar"右键单击您的 Finder 工具栏并选择“自定义工具栏”
  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单击并拖动icon_terminal_light.icns到左上角的图标上

Notice:注意:

If you move the Finder toolbar to a non-retina screen, the icon will look thin and the edges will be jagged.如果将 Finder 工具栏移动到非 Retina 屏幕上,图标看起来会变细并且边缘会出现锯齿状。

You can even open icon_terminal_light.icns in Preview, resize it to 32x32, and then export it to a new icns file.您甚至可以在预览中打开icon_terminal_light.icns ,将其调整为 32x32,然后将其导出到新的 icns 文件。 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. icns 文件在非 Retina 显示器上看起来很平滑,但如果您尝试将它放入工具栏,它会再次出现锯齿状。

Finder has a quirk whereby the alpha layers of toolbar icons get multiplied by two when the window is active. Finder 有一个怪癖,当 window 处于活动状态时,工具栏图标的 alpha 层会乘以二。 If the Finder window is in the background, however, the icons probably look how'd you expect.但是,如果 Finder window 在后台,图标可能看起来像您期望的那样。

If your icons have any thin graphical element, the anti-aliased pixels will have low alpha values.如果您的图标有任何细图形元素,抗锯齿像素将具有低 alpha 值。 When those alpha values are doubled, the pixels practically disappear, which is what looks like is happening.当这些 alpha 值加倍时,像素几乎消失了,这看起来像是正在发生的事情。

I solved this issue when trying to resize the icons provided in OpenInTerminal-Light .我在尝试调整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.为了修复渲染,我手动调整了图标的大小并在抗锯齿像素后面添加了 89% 的灰色。 Every pixel has either 0% or 100% alpha now.现在每个像素都具有 0% 或 100% 的 alpha。

You can see more detailed notes in the issue I opened on GitHub .你可以在我在 GitHub 上打开的问题中看到更详细的注释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Retina版本的图像始终用于非视网膜显示器 - Retina version of an image always used on non-retina display Mac上的SKCameraNode定位:非视网膜vs视网膜 - SKCameraNode positioning on Mac: non-retina vs retina NSImage旋转在非视网膜上使用块代码模糊 - NSImage rotation using block code blurry on non-retina 如何使用可可在OS X中将视网膜切换到非视网膜 - How can I switch retina to non-retina in OS X with cocoa 如何在Mac OS X 10.8 Mountain Lion的非视网膜显示器上模拟视网膜显示器(HiDPI模式)? - How to simulate a retina display (HiDPI mode) in Mac OS X 10.8 Mountain Lion on a non-retina display? 在NSImage上使用lockFocus时,如何强制非视网膜图像? - How do you force a non-retina image when using lockFocus on an NSImage? 如何在资源目录中不在OS X的视网膜/非视网膜屏幕上以相同的方法加载图像? - How to load image with same method in both retina/non-retina screen under OS X that's not in the Resources directory? 使用NSAttributedString绘图时在非视网膜Mac上的字体渲染模糊 - Blurry font rendering on non-retina Macs when using NSAttributedString drawing 为什么非视网膜macs加载2x版本的图片元素? - Why do non-retina macs load the 2x version of a picture element? 向Finder工具栏添加按钮? - Adding buttons to Finder toolbar?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM