Imagemagick:删除alpha组件(用实心像素替换所有中间的alpha像素) [英] Imagemagick: remove alpha component (replace all intermediate alpha pixel with solid pixel)

查看:887
本文介绍了Imagemagick:删除alpha组件(用实心像素替换所有中间的alpha像素)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要解决



其他找到的链接




解决方案



  convert input.png -alpha off output.png 

如果你想做一个完整的文件层次结构。

  -name.png-exec convert{}-alpha off{}\; 

请测试您的文件的COPY是否正确。



...



请参阅下面的对话框,答案是基于我们需要删除不是255的alpha

  convert input.png -channel A -threshold 254 output.png 

和批处理

  mkdir批处理
FOR%G IN * .png)DO convert%G -channel A -threshold 254 batch\%G


To solve Android build issue I need to replace all intermediate alpha pixel with solid pixel (leaving transparent background as is).

How to that with ImageMagick or other-command line tool to all image in a tree?

Image bg_all_block.9.png

Image btn_bg_common_press.9.png

UPDATE: I have found that I can detect if alpha is used, as in Detect Alpha Channel with ImageMagick

Other found links

解决方案

You can do

convert input.png -alpha off output.png

If you want to do a whole hierarchy of files

find . -name ".png" -exec convert "{}" -alpha off "{}" \;

Please test on a COPY of your files to be sure.

...

see dialog below, and the answer is based on that "we need to remove alpha that is not 255"

convert input.png -channel A -threshold 254 output.png

and for batch

mkdir batch
FOR %G IN (*.png) DO convert %G -channel A -threshold 254 batch\%G

这篇关于Imagemagick:删除alpha组件(用实心像素替换所有中间的alpha像素)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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