Re: How to make color from top left pixel transparent?
Posted: 2008-04-27T15:09:50-07:00
Do you want every pixel with that same color to be transparent or only the top left pixel to be transparent?
The former can be done either in two command lines:
color=`convert logo: -format "%[pixel:p{0,0}]" info:`
convert logo: -transparent $color logo_tmp.png
or combined into one command line
convert logo: -transparent $(echo `convert logo: -format "%[pixel:p{0,0}]" info:`) logo_tmp.png
see fx escapes:
http://www.imagemagick.org/Usage/transform/#fx_escapes
The latter can be done as follows:
convert rose: -alpha on -channel RGBA -fx "i==0&&j==0?none:u" rose_tmp.png
The former can be done either in two command lines:
color=`convert logo: -format "%[pixel:p{0,0}]" info:`
convert logo: -transparent $color logo_tmp.png
or combined into one command line
convert logo: -transparent $(echo `convert logo: -format "%[pixel:p{0,0}]" info:`) logo_tmp.png
see fx escapes:
http://www.imagemagick.org/Usage/transform/#fx_escapes
The latter can be done as follows:
convert rose: -alpha on -channel RGBA -fx "i==0&&j==0?none:u" rose_tmp.png