Using IM 6.9 on Windows, I am stuck for hours on a very simple case : masking a source Png image with a Black and white mask !
I am stuck on the 4th step, when composing.
- Step 1. I have a colorful source image in Png.
- Step 2. I Crop a portion, apply a paint effect to it, then add a 4px border around it : IT WORKS.
- Step 3. I create a rounded mask of the size of this image : IT WORKS.
- Step 4. I apply the mask to the image, in order to remove its corners : IT DOES NOT WORK.
Could you point me to my error ?
Thank you very much
Here is my code (divided into several lines, and commented, just to make it clear for you).
(I obviously use it into a single line !)
Code: Select all
#STEP 1 : The source file :
Code: Select all
#STEP 2 : crop, paint, then add the lightblue border the source transparent Png : 4px rounded rectangle : WORKS
convert MY_FILE_IN.PNG -crop 690x690+555+555 +repage -paint 4 -stroke #e2efff -strokewidth 4 -fill transparent -draw "roundrectangle 2,2 689,689 5,5" -write mpr:DstImageBordered +delete
Code: Select all
#STEP 3 : create a mask : a rounded rectangle : WORKS
convert -size 692x692 xc:black -fill white -draw "roundrectangle 0,0 691,691 5,5" -write mpr:DstImageCutMask +delete
Code: Select all
#STEP 4 : mask the source image with the firstly created mask : DOES NOT WORK
mpr:DstImageCutMask mpr:DstImageBordered -alpha Off -compose CopyOpacity -composite MY_FILE_OUT.PNG