Page 1 of 1
Composite + gravity using -compose Xor
Posted: 2008-10-20T11:07:20-07:00
by jnimo
Hello again and thanks for all the help that you have give me until today
I have another problem, perhaps someone could help me with this. I have 2 image SD.png and inside.jpg, SD.png is a rounded image (like a 1/4 of a circle) black and transparent and inside.jpg is a picture, I want to use this image (SD.png) to make a rounded corner in the image, so I have use this comand
Code: Select all
composite -compose Xor -gravity NorthEast SD.png inside.jpg out.png
It works because it leave the transparent part but it does too leave the black part and I need that to work like copyopacity, I have try too to use this other command
Code: Select all
composite -gravity NorthEast -compose copyopacity SD.png inside.jpg out.png
but it just leave a big transparent image, so if someone could help I will be really apreciate. thanks
Jimmy Nimo
Re: Composite + gravity using -compose Xor
Posted: 2008-10-20T11:59:25-07:00
by jnimo
I have found a workaround but I don't think it the best approach
Code: Select all
composite -compose Src -gravity NorthEast SD.png inside.jpg temp2.png
convert temp2.png -transparent white temp3.png
composite -compose copyopacity temp3.png inside.jpg salida2.png
composite -compose Src -gravity Southwest II.png inside.jpg temp2.png
convert temp2.png -transparent white temp3.png
composite -compose Dst_in temp3.png salida2.png salida3.png
composite -compose Src -gravity Southeast ID.png inside.jpg temp2.png
convert temp2.png -transparent white temp3.png
composite -compose Dst_in temp3.png salida3.png salida4.png
composite -compose Src -gravity Northwest SI.png inside.jpg temp2.png
convert temp2.png -transparent white temp3.png
composite -compose Dst_in temp3.png salida4.png def.png
in def.png I have the image I want but, come on it has to be another way to do this, I fell that I'm making to much work for this, any Ideas?
Re: Composite + gravity using -compose Xor
Posted: 2008-10-20T12:29:01-07:00
by fmw42
post your images so we can try to give you a good method to follow and test it.
Re: Composite + gravity using -compose Xor
Posted: 2008-10-20T13:02:49-07:00
by Bonzo
Is this what you are looking to do ?
Code: Select all
convert -size 637x140 xc:none -fill white -draw "roundRectangle 0,0 637,140 15,15" albir.jpg -compose SrcIn -composite rounded_corners.png
Re: Composite + gravity using -compose Xor
Posted: 2008-10-20T13:35:18-07:00
by jnimo
yes I want that but I want to control the smothness of the rounded corner, so I'm trying to make in that approach, can I control the rounded edge with that command?
Re: Composite + gravity using -compose Xor
Posted: 2008-10-20T14:10:45-07:00
by Bonzo
Not completly sure what you mean but:
roundRectangle 0,0 637,140 15,15 - 15,15 is the size of the corner radii
Re: Composite + gravity using -compose Xor
Posted: 2008-10-21T23:38:05-07:00
by anthony
For an alterantive that does not require for knowledge of the image size see IM Examples, Thumbnails, Rounded Corners
http://www.imagemagick.org/Usage/thumbnails/#rounded