Using FX to create a custom transparency mask
Posted: 2017-05-24T04:19:58-07:00
Hello,
Thx to the documentation, I was able to create a mask of transparency gradient.
I have been tweaking the function but I have a really hard time to understand what I am doing.
The end state I want to reach is being able to produce a mask that will be used to produce a frame (so, to keep the borders of a given image) and the frame will not be symetrical.
My strategy is to produce bottom, top, right and left part independently and to fuse them in some way (I also didn't achieve the fuse part yet).
Here is what I achieved for the moment :
==> produce a symetrical frame
==> produce the bottom part of the frame
What I am looking into doing is having an fx function where I can put my own measures (the size of the width of the transparency fading).
Any pointer or comment would be useful.
Thx to the documentation, I was able to create a mask of transparency gradient.
I have been tweaking the function but I have a really hard time to understand what I am doing.
The end state I want to reach is being able to produce a mask that will be used to produce a frame (so, to keep the borders of a given image) and the frame will not be symetrical.
My strategy is to produce bottom, top, right and left part independently and to fuse them in some way (I also didn't achieve the fuse part yet).
Here is what I achieved for the moment :
Code: Select all
convert -size 700x1200 xc: -channel G -fx '1-(1-(2*i/w-1)^4)*(1-(2*j/h-1)^4)' -separate gradient_fx_quad2.gif
Code: Select all
convert -size 700x1200 xc: -channel G -fx '(2*j/h-1)' -separate gradient_fx_quad2.gif
What I am looking into doing is having an fx function where I can put my own measures (the size of the width of the transparency fading).
Any pointer or comment would be useful.