Page 1 of 1

how to put a texture on a .png image with transparent background

Posted: 2019-08-01T21:42:11-07:00
by direction
Input image 1: texture image
Image

Input image 2: .png image file which have a 'deboss' effect
Image


Expected output image with transparent background, deboss effect (not so good as the input image 2, this is best result I can do) and texture:
(I used Photoshop)
Image

Re: how to put a texture on a .png image with transparent background

Posted: 2019-08-01T22:20:14-07:00
by fmw42
Try this:

Code: Select all

convert input-texture.png \
\( out2_a315.png -channel a -negate +channel \) \
\( +clone -alpha extract -negate +write mpr:alpha +delete \) \
-compose multiply -composite \
mpr:alpha -alpha off -compose over -compose copy_opacity -composite \
emboss_texture.png

Re: how to put a texture on a .png image with transparent background

Posted: 2019-08-02T03:24:25-07:00
by direction
fmw42 wrote: 2019-08-01T22:20:14-07:00 Try this:

Code: Select all

convert input-texture.png \
\( out2_a315.png -channel a -negate +channel \) \
\( +clone -alpha extract -negate +write mpr:alpha +delete \) \
-compose multiply -composite \
mpr:alpha -alpha off -compose over -compose copy_opacity -composite \
emboss_texture.png
I tried it. below is the output image. Seems like it lost the 'deboss' effect:
Image

Re: how to put a texture on a .png image with transparent background

Posted: 2019-08-02T09:32:04-07:00
by fmw42
Tell us the steps you uses in PS to create it.

Re: how to put a texture on a .png image with transparent background

Posted: 2019-08-02T18:50:10-07:00
by direction
fmw42 wrote: 2019-08-02T09:32:04-07:00 Tell us the steps you uses in PS to create it.
In photoshop.
I overlay two layers, push Alt button, and used the 'Mask' to get the effect.

Hi fmw42,
Just find another way to get the expected result, IM should be able to do it..
I used Photoshop, right click layer - layer style - bevel and emboss -out put image. The effect is like below:

Input image:
Image

Output image (with a little 'deboss' effect, more is better:) -
I can not simply use "emboss -a 315 ..." to get the expected image.

Image

Re: how to put a texture on a .png image with transparent background

Posted: 2019-08-02T21:16:55-07:00
by fmw42
try this:

Code: Select all

convert img.png \
\( -clone 0 -alpha extract -morphology dilate diamond:1 -write mpr:alpha +delete \) \
texture.png -compose multiply -composite \
mpr:alpha -alpha off -compose copy_opacity -composite result.png

Re: how to put a texture on a .png image with transparent background

Posted: 2019-08-03T17:43:29-07:00
by direction
fmw42 wrote: 2019-08-02T21:16:55-07:00 try this:

Code: Select all

convert img.png \
\( -clone 0 -alpha extract -morphology dilate diamond:1 -write mpr:alpha +delete \) \
texture.png -compose multiply -composite \
mpr:alpha -alpha off -compose copy_opacity -composite result.png
fmw42, It works. Thanks. :)