Page 2 of 2

Re: Multiply image anti-aliasing problem

Posted: 2014-11-25T23:59:49-07:00
by fmw42
I am not sure if you want it fully or partially transparent. If fully, then this code has extra components that are not needed. Before you were asking about partially transparent. Here is a result without blur and with the material 50% transparent. You really need to be more clear about your requirements.


convert c5VyQ.png \( pK1xB.jpg -alpha set -channel alpha -evaluate set 50% +channel -write show: \) \
\( -clone 0 +level-colors "black,#B6977A" -write show: \) \
\( -clone 0 -morphology open octagon:3 \
-fuzz 10% -transparent white -channel rgba \
-fill "rgba(255,255,255,1)" +opaque none -fill "rgba(0,0,0,1)" -opaque none -write show: \) \
-delete 0 -compose over -composite result6.png

Image

Re: Multiply image anti-aliasing problem

Posted: 2014-11-26T04:18:55-07:00
by snibgo
nagarwal wrote:this is close to the result I needed but it has some blur in it. can we make the material part transparent so that different materials can be fit in the background on the fly?
My method has no blur.

To make the bricks partially transparent, you can adjust my method with the code that Fred gives:

Code: Select all

convert ^
  4Biet.png ^
  -crop 1x3@ +repage ^
  b.png

convert ^
  ( b-1.png -fill rgb(100%%,75%%,30%%) -colorize 50 +write bf.png ) ^
  ( pK1xB.jpg -fill rgb(100%%,40%%,30%%) -colorize 50 +write bb.png ^
    -alpha set -channel A -evaluate set 80%% +channel ) ^
  b-0.png ^
  -composite ^
  -gravity center -crop 1000x+0+0 +repage ^
  bricks.png

Re: Multiply image anti-aliasing problem

Posted: 2014-11-26T04:24:14-07:00
by nagarwal
snibgo wrote:
nagarwal wrote:this is close to the result I needed but it has some blur in it. can we make the material part transparent so that different materials can be fit in the background on the fly?
My method has no blur.

To make the bricks partially transparent, you can adjust my method with the code that Fred gives:

Code: Select all

convert ^
  4Biet.png ^
  -crop 1x3@ +repage ^
  b.png

convert ^
  ( b-1.png -fill rgb(100%%,75%%,30%%) -colorize 50 +write bf.png ) ^
  ( pK1xB.jpg -fill rgb(100%%,40%%,30%%) -colorize 50 +write bb.png ^
    -alpha set -channel A -evaluate set 80%% +channel ) ^
  b-0.png ^
  -composite ^
  -gravity center -crop 1000x+0+0 +repage ^
  bricks.png

Okay, and can be the material part in the relutant image made transparent?

Re: Multiply image anti-aliasing problem

Posted: 2014-11-26T06:04:18-07:00
by snibgo
Reverse the order of composition:

Code: Select all

convert ^
  4Biet.png ^
  -crop 1x3@ +repage ^
  b.png

convert ^
  ( pK1xB.jpg -fill rgb(100%%,40%%,30%%) -colorize 50 +write bb.png ^
    -alpha set -channel A -evaluate set 80%% +channel ) ^
  ( b-1.png -fill rgb(100%%,75%%,30%%) -colorize 50 +write bf.png ) ^
  ( b-0.png -negate ) ^
  -alpha off ^
  -composite ^
  -alpha on ^
  -gravity center -crop 1000x+0+0 +repage ^
  bricks.png