如何区分 png8 和 png24

发布于 2024-07-09 02:50:13 字数 463 浏览 10 评论 0原文

我正在开发一个使用大量 png24 文件的网站,以提高透明度。

我需要用 png8 文件替换它们,因为 png24 的所有 png 修复样式 javascript 解决方法都会导致 IE6 随机锁定。

请参阅此链接以了解 IE6 显示的症状 - http://blogs.cozi.com/tech/2008/03/transparent-pngs-can-deadlock-ie6.html

有谁知道一种针对现有 png24 文件的简单方法,将它们替换为png8s?

我使用的是 OS X,像 Adob​​e Bridge 这样的文件浏览器不会显示此信息,我也无法在命令行或查找器上找到该信息。

帮助!

I'm working on a website that uses lots of png24 files, for transparency.

I need to replace them with png8 files, as all the png fix style javascript workarounds for png24 cause IE6 to lock up randomly.

See this link to get an idea of the symptoms IE6 displays - http://blogs.cozi.com/tech/2008/03/transparent-pngs-can-deadlock-ie6.html

Does anybody know an easy way of targeting existing png24 files, to replace them with the png8s?

I'm using a OS X, and file browsers like Adobe bridge don't show this, nor can I find the info on the commandline, or the finder.

Help!

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

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

发布评论

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

评论(7

£噩梦荏苒 2024-07-16 02:50:13

OSX 上的 file 实用程序可以告诉您 PNG 文件中的颜色深度,例如:

% file foo.png 
foo.png: PNG image data, 1514 x 1514, 8-bit grayscale, non-interlaced

The file utility on OSX can tell you the colour depth in a PNG file, e.g:

% file foo.png 
foo.png: PNG image data, 1514 x 1514, 8-bit grayscale, non-interlaced
护你周全 2024-07-16 02:50:13

实际上,您可以在 PNG-8 中获得 Alpha 透明度,但它非常复杂。
http://www.sitepoint.com/blogs /2007/09/18/png8-the-clear-winner/
http://www.personal.psu.edu/ drs18/blogs/davidstong/2007/09/png8_alpha_transparency_from_f.html

它基本上为 IE6 创建类似 GIF 的内容,并为更好的浏览器创建具有 alpha 透明度的真实 PNG。 这是一条更令人愉快的退化路径。 现在,我认为您需要 Fireworks,但我正在探索其他选择。

You actually CAN get alpha transparency in PNG-8's but it's super complicated.
http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/
http://www.personal.psu.edu/drs18/blogs/davidstong/2007/09/png8_alpha_transparency_from_f.html

It basically creates GIF like substance for IE6 and a real PNG with alpha transparency for better browsers. It's a more pleasant degradation path. Right now, I think you need Fireworks, but I am exploring other options.

紫轩蝶泪 2024-07-16 02:50:13

要添加到 Alnitak 的答案中,一旦找到要转换的所有 PNG24,您可以使用 pngquant 对它们进行批处理:

pngquant -v -f --ext .png 256 *.png

这会将所有 PNG 文件就地转换为 PNG8,并覆盖它们。

To add to Alnitak’s answer, once you find all PNG24 you want to convert, you can batch them all with pngquant:

pngquant -v -f --ext .png 256 *.png

This converts all PNG files to PNG8 in place, overwriting them.

岁月如刀 2024-07-16 02:50:13

我认为你可能问错了问题。 PNG8 没有您一直在 IE6 中努力修复的 true-alpha。 如果用 PNG8 替换 PNG24,并不比用 GIF 替换它们更好。

也许你可以测试一个替代的替换/修复脚本 - 有一些非常糟糕的脚本,也许这就是问题所在?

这是(我是开玩笑说的!) 正确的问题

I think you might be asking the wrong question. PNG8s don't have the true-alpha you've been working hard to fix in IE6. If you replace the PNG24s with PNG8s you are no better off than replacing them with GIFs.

Maybe you could test an alternative replacement/fix script - there are some shockingly bad ones out there, maybe that's where the problem is?

Here's (and I say this tongue in cheek!) the right question.

我很坚强 2024-07-16 02:50:13

乔博客是对的,你问错了问题。

我从来没有用一个好的 pngfix 脚本让 IE6 崩溃。 您要么安装了错误的 pngfix 脚本,要么安装了错误的 IE6。

PNG8 会毁掉你漂亮的透明胶片,让你看起来像是在使用 GIF。

JoeBloggs is right, you're asking the wrong question.

I've never had IE6 break with a good pngfix script. You've either got a bad pngfix script, or a bad IE6 install.

PNG8 will ruin your nice transparencies and make it look like you're using GIFs.

久隐师 2024-07-16 02:50:13

pngcheck 是一个命令行工具,可以转储您需要的信息。 http://www.libpng.org/pub/png/apps/pngcheck.html

pngcheck.exe a.png
OK: a.png (1024x1024, 32-bit RGB+alpha, non-interlaced, 80.7%).

pngcheck.exe b.png
OK: b.png (1024x1024, 8-bit palette+trns, non-interlaced, 83.1%).

pngcheck, a command line tool, can dump the information you need. http://www.libpng.org/pub/png/apps/pngcheck.html

pngcheck.exe a.png
OK: a.png (1024x1024, 32-bit RGB+alpha, non-interlaced, 80.7%).

pngcheck.exe b.png
OK: b.png (1024x1024, 8-bit palette+trns, non-interlaced, 83.1%).
临走之时 2024-07-16 02:50:13

也许 imagemagick 可以帮助您将 png24 文件转换为 png8 文件。

Perhaps imagemagick helps you out at converting png24 files to png8 files.

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