2014-11-24 73 views
0

原始圖像:imagmgick多個彩色和透明圖像與抗鋸齒

enter image description here

這什麼需要來實現。 enter image description here

磚圖片: enter image description here

我有很多相似圖片下面的一個

enter image description here

我需要乘以一個顏色這一形象說「RGBA(103,68,56 ,5)「,並使中心白色部分透明。

的方式我做的:

轉換mortar.png(-clone 0 - 填充 'RGBA(103,68,56,5)' -colorize 100)聲道RGBA-α對-compose乘 - 複合mortar.png

轉換mortar.png -transparent 'RGBA(103,68,56,5)' mortar.png

所得圖像I得到的是:

enter image description here

所需圖像的位置如下所示:只需查看圖像的內角線和白色區域上的點即可忽略。

enter image description here

我有不同的模糊值嘗試以及但這會使圖像更加放孔的顏色區域。

請用鼠標右鍵單擊圖像並將其保存在您的位置中,以查看完整的圖像是什麼樣的。

與命令添加模糊後

輸出

轉換m.png -blur 0x.3(+克隆-fill 'RGBA(103,68,56,5)' -colorize 100)聲道RGBA -alpha上-compose乘法 - 複合-transparent 'RGBA(103,68,56,5)' out.png

enter image description here

希望的輸出:

enter image description here

回答

0

更新回答

我認爲問題是,你原來的迫擊炮圖像已經是邊界周圍嘈雜。我把它放入Photoshop並放大了很多,你可以看到它周圍有嘈雜的人造物品。

enter image description here

我只能想到這些模糊,然後他們設定閾值達到純白色,因爲有些嘈雜位的居然還發生在現實的邊界,你不希望他們去透明的。我正在考慮沿着這些路線:

convert mortar.png -blur 0x3 -white-threshold 95% -transparent white \(+clone -fill 'rgb(103,68,56)' -colorize 100 \) -compose Multiply -composite out.png 

不知道還有什麼建議。

原來的答案

我想你可能會發現它有用添加模糊處理的一個微小的量,以幫助邊緣,並且還做這一切在一個這樣的:

convert mortar.png -blur 0x.3 \(+clone -fill 'rgba(103,68,56,5)' -colorize 100 \) -channel rgba -alpha on -compose Multiply -composite -transparent 'rgba(103,68,56,5)' out.png 
+0

我有用命令的輸出和期望的輸出更新了問題。你能看看嗎? – 2014-11-24 10:12:47

+0

我已添加了原始圖像中的原始圖像。我認爲我們可以使用原始圖像做一些事情,因爲它有alpha圖像。請看一看。 – 2014-11-25 04:52:59

+0

看看原來的問題,我添加了需要實現的流程圖。 – 2014-11-25 05:40:32