Multiply image anti-aliasing problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiply image anti-aliasing problem

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Multiply image anti-aliasing problem

Post 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
snibgo's IM pages: im.snibgo.com
nagarwal
Posts: 13
Joined: 2014-11-24T04:16:09-07:00
Authentication code: 6789

Re: Multiply image anti-aliasing problem

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Multiply image anti-aliasing problem

Post 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
snibgo's IM pages: im.snibgo.com
Post Reply