Inkscape:抗锯齿 png 图标在移动到 Windows 时会丢失颜色?

发布于 2024-12-20 10:19:30 字数 847 浏览 0 评论 0原文

这一定是一个愚蠢的问题...我刚刚安装了 Inkscape,并且很快就成功地绘制了一个抗锯齿 png 图标,16x16,它只是一个带有颜色渐变的空心圆(我也尝试过使用灰度梯度,结果相同)。我将图像创建为 svg,并导出 png 位图。当我将 png 位图读回 Inkscape 时,它​​看起来与抗锯齿圆应有的样子一模一样。

问题就在这里。如果我将 png 读入在 Windows 上运行的 Paint Shop Pro,它看起来并不一样。设置了相同的像素,但颜色发生了变化,图像现在只是锯齿状,而不是抗锯齿。颜色范围似乎缩小了。我在 Inkscape 中找不到任何内容告诉我图像中有多少种颜色,或者它们是什么,但 PSP 报告图像中有 40 种 24 位颜色,这似乎是正确的。它们只是颜色不对;他们更加饱和。

知道我做错了什么吗?谢谢。

编辑

好的,在 http://cyconix.com/pub 整理了一些屏幕截图。 Circle-blue.png 是原始的 16x16 png,在 Inkscape 上创建。当我从这个 URL 读回 png 时,并且:

(1)将其加载到 Windows 上的 PSP 中,然后截图,我得到 psp-screenshot.jpg;

(2)将其加载到Linux上的Inkscape中,然后截图,我得到inkscape-screenshot.jpeg。

Windows 程序之间对于如何解释 png 似乎存在一些分歧。 Paint、PSP 和“Quicktime PictureViewer”显示块状版本。 “Windows 图片和传真查看器”似乎正确显示(我不能确定)。请注意,我运行的是 XP,这些是程序的旧版本。

This has got to be a dumb question... I just installed Inkscape, and very quickly managed to draw an anti-aliased png icon, 16x16, which is just a hollow circle with a colour gradient (I've also tried with a grayscale gradient, with the same result). I created the image as an svg, and exported a png bitmap. When I read the png bitmap back into Inkscape, it looks exactly like an anti-aliased circle should look.

Here's the problem. If I read the png into Paint Shop Pro, running on Windows, it doesn't look the same. The same pixels are set, but the colours have changed in such a way that the image is now just jaggy, rather than anti-aliased. The colour range seems to have shrunk. I can't find anything in Inkscape that tells me how many colours there are in the image, or what they are, but PSP is reporting that there are 40 24-bit colours in the image, which seems about right. They're just the wrong colours; they're more saturated.

Any idea what I'm doing wrong? Thanks.

EDIT

Ok, sorted out a couple of screenshots, at http://cyconix.com/pub. circle-blue.png is the original 16x16 png, created on Inkscape. When I read back the png from this URL, and:

(1) load it into PSP on Windows, and then take a screenshot, I get psp-screenshot.jpg;

(2) load it into Inkscape on Linux, and then take a screenshot, I get inkscape-screenshot.jpeg.

There seems to be some disagreement among Windows programs on how to interpret the png. Paint, PSP and 'Quicktime PictureViewer' show the blocky version. 'Windows Picture and Fax Viewer' appears to show it correctly (I can't be sure). Note that I'm running XP, and these are old versions of the programs.

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

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

发布评论

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

评论(1

纵性 2024-12-27 10:19:30

PSP 似乎没有加载 Alpha 通道,这就是为什么你看不到它的抗锯齿效果。
也许您的 PSP 版本无法处理 Alpha 通道。

有些应用程序根本不支持透明度(例如Windows Paint),有些应用程序不支持alpha通道,它们只支持二进制透明度(打开或关闭)。

您的 PNG 具有完整的 Alpha 通道,即每个像素有 255 个透明度级别,这就是 Inkscape 导出它的方式。
如果您不需要透明度,您可以在 Inkscape 中添加白色背景,然后您将获得正确的白色抗锯齿图像。

当我想编辑光栅图像时,我使用 Gimp。

It seems PSP is not loading the alpha channel, that's why you don't see it antialiased.
Maybe your version of PSP can't handle alpha channel.

Some applications don't support transparency at all (e.g. Windows Paint), and some applications don't support an alpha channel, they just support a binary transparency (on or off).

Your PNG has a full alpha channel, i.e. 255 levels of transparency on each pixel, that's how Inkscape exports it.
If you don't need transparency you can add a white backgroud in Inkscape and you will get a correctly antialiased image on white.

When I want to edit raster images I use Gimp.

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