clipping a texture by a transparent png mask

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?".
Post Reply
artech
Posts: 10
Joined: 2018-10-08T09:10:04-07:00
Authentication code: 1152

clipping a texture by a transparent png mask

Post by artech »

Hi everyone,

I just want to crop a jpg file with a transparent png mask. tried different composition of commands but non of them gave me the result.

here's an example I did with gimp:

texture:
Image

mask:
Image

what i want as result
Image

Thanks in advance
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: clipping a texture by a transparent png mask

Post by snibgo »

Code: Select all

magick texture.jpg mask.png -compose CopyOpacity -composite out.png
snibgo's IM pages: im.snibgo.com
artech
Posts: 10
Joined: 2018-10-08T09:10:04-07:00
Authentication code: 1152

Re: clipping a texture by a transparent png mask

Post by artech »

It worked great, I was doing it in complex ways but it was that simple.

Many Thanks
Post Reply