“-type truecolorAlpha”不起作用 [英] "-type truecolorAlpha" does not work

查看:490
本文介绍了“-type truecolorAlpha”不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些类型为 PaletteAlpha 且必须为 TrueColorAlpha 的图像。我正在尝试使用命令

I have some images whose type is PaletteAlpha and which have to be TrueColorAlpha. I am trying to use the command

convert testein -type TrueColorAlpha testeou

进行此转换,但结果是仍然有的图像类型:PaletteAlpha 。这种行为有望吗?如何从一种类型转换为另一种类型?

to do this conversion but the result is an image which still has Type: PaletteAlpha. Is this behaviour expected? How can I transform from one type to the other?

我还尝试了诸如 PNG:testeou 之类的东西但是没有结果。
我的IM版本是 6.7.8-9

I have also tried things such as PNG:testeou but with no results. My IM version is 6.7.8-9.

推荐答案

PNG32:前缀强制输出PNG为RGBA:

The PNG32: prefix forces the output PNG to be RGBA:

convert logo: -transparent white png32:logot32
identify -verbose logot32 | grep Type
  Type: PaletteAlpha
pngcheck logot32
  OK: logot32 (640x480, 32-bit RGB+alpha, non-interlaced, 94.1%).

识别报告图像读入后的类型。在这种情况下,它是一个透明度低于256色的图像,因此报告为PaletteAlpha。

"identify" reports the "Type" of the image after it has been read in. In this case, it is an image with transparency and fewer than 256 colors, so it's reported as PaletteAlpha.

pngcheck报告实际存储在PNG文件中的内容,即RGBA。

"pngcheck" reports what's actually stored in the PNG file, which is RGBA.

事实上,识别还提供了有关PNG文件的更多信息。接近识别-verbose输出的末尾可以找到:

In fact, "identify" also gives more information about the PNG file. Near the end of the "identify -verbose" output can be found:

Properties:
...
png:IHDR.bit_depth       : 8
png:IHDR.color_type      : 6 (RGBA)
png:IHDR.interlace_method: 0 (Not interlaced)
png:IHDR.width,height    : 640, 480
...
Version: ImageMagick 6.7.8-9 2015-06-01 Q16 http://www.imagemagick.org

这篇关于“-type truecolorAlpha”不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆