iPhone 透明图像渲染不佳

发布于 2024-09-04 16:16:03 字数 944 浏览 4 评论 0原文

我正在开发一个 iPad 应用程序。我收到了一张 PNG 图像,其中包含一些透明度 - 基本上是一个投影。我遇到的问题是,无论是在设备上还是在 sim 中,该应用程序在应用程序中的渲染效果都很差。

我制作了一些示例来说明。第一个是图像在 PSD 中的显示方式(正确的是)。第二个是它在设备上的显示方式。您可以看到图像中间的阴影条明显更黄并且看起来很差。

PDF http://www.aspyre.com.au/stackoverflow/photoshop.png 在设备上 http://www.aspyre.com.au/stackoverflow/device。 png

你知道我做错了什么吗?

编辑:文件链接: - PNG - PSD

编辑2:我也尝试过 pngcrush 来删除伽玛,万一这引起了问题,但运气不好。我遵循的方向在这里:pngcrush

I'm developing an iPad application. I have been provided with a PNG image that contains some transparency - basically a drop shadow. The problem I'm having is that this is rendering poorly within the application, both on the device and in the sim.

I've made up some samples to illustrate. The first is how the image appears in the PSD (correctly that is). The second is how it appears on the device. You can see that the strip of shadow in the middle of the image is distinctly more yellow and poorly looking.

PDF http://www.aspyre.com.au/stackoverflow/photoshop.png On Device http://www.aspyre.com.au/stackoverflow/device.png

Any ideas what I'm doing wrong?

Edit: Links to files:
- PNG
- PSD

Edit 2: I've also tried pngcrush to remove the gamma, in case that was causing a problem, but no luck. Directions I followed were here: pngcrush

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

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

发布评论

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

评论(5

浅唱々樱花落 2024-09-11 16:16:03

阴影中出现颜色的原因是 PSD 的阴影层设置为“正片叠底”并且其中有颜色。当您在没有背景的情况下导出它时,Photoshop 无法将其与任何内容相乘,而只是按原样使用图层。您需要抓取阴影图层的选区,创建一个新图层,然后用黑色填充该选区。然后将新图层的不透明度设置为模仿旧阴影的值。

另外,如果您还没有使用 Save-For-Web,我建议您使用它。您使用的颜色配置文件并不是什么大问题,因为它将被剥离。然而,在制作 iPhone/iPad 图形时,您希望使用 sRGB,这一点是正确的。

调整后的 PSD 链接:PSD

The reason you're getting a colour in your shadow is because the PSD's shadow layer is set to Multiply and has a colour in it. When you export it without a background, Photoshop is unable to multiply it to anything and just uses the layer as is. You need to grab the selection of the shadow layer, create a new layer, and fill that selection with black. Then set that new layer's opacity to something that mimics the old shadow.

Also I recommend you use Save-For-Web if you don't already. The colour-profile you use isn't much of an issue then as it will be stripped. However the point is valid that you want to be in sRGB when making iPhone/iPad graphics.

Link to your PSD adjusted: PSD

梦过后 2024-09-11 16:16:03

常见错误:

  1. 您的色彩空间不标准。要么不使用颜色空间,要么指定 sRGB(强烈推荐)。
  2. 您没有保存包含伽马信息的 PNG。

Common mistakes:

  1. Your color space is non-standard. Either use no color space, or specify sRGB (strongly preferred).
  2. You didn't save the PNG with gamma information included.
花开柳相依 2024-09-11 16:16:03

如果无法访问实际文件,我们就只能抓住救命稻草了。也许您有 8 位而不是 24 位 png?

Without access to the actual files we're grasping at straws.. Maybe you have an 8-bit instead of 24-bit png?

只是我以为 2024-09-11 16:16:03

对于阴影,请使用黑色而不是灰色。然后调整透明度。那应该解决它。

For your shadow, use black instead of gray. Then adjust the transparency. That should fix it.

手心的海 2024-09-11 16:16:03

我遇到了类似的问题,通过禁用图像压缩解决了这个问题。这是在 XCode 中通过删除 .png 扩展名来完成的。您可以通过编辑“压缩 PNG 文件”项目设置来禁用整个项目的 png 压缩,但不建议这样做。

有关 Xcode PNG 压缩的更多详细信息: http://iphonedevelopment.blogspot.com /2008/10/iphone-optimized-pngs.html

I had a similar issue that I resolved by disabling compression for an image. This is done in XCode by removing the .png extension. You can disable png compression for an entire project by editing the 'Compress PNG Files' project setting, but it is not recommended.

More details about Xcode PNG compression: http://iphonedevelopment.blogspot.com/2008/10/iphone-optimized-pngs.html

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