“-type truecolorAlpha” does not work

风格不统一 提交于 2020-01-03 03:38:12

问题


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

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?

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


回答1:


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%).

"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" reports what's actually stored in the PNG file, which is RGBA.

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


来源:https://stackoverflow.com/questions/30575363/type-truecoloralpha-does-not-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!