Hi.. How to generate a faded line using Convert command...
Image as shown below...
How to create faded lines using "convert" commandline
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to create faded lines using "convert" commandline
The important part is a one-dimensional graduation from black at the left, through various colours, to black at the right. Then there is black at the top, and black and white at the bottom. After making the graduation, you could use "-extent" twice.
For the gradient, I show many methods on my pages http://im.snibgo.com/ckbkClut.htm#colour and http://im.snibgo.com/gradients.htm . How is your gradient defined? Perhaps with three colours? Or more?
For the gradient, I show many methods on my pages http://im.snibgo.com/ckbkClut.htm#colour and http://im.snibgo.com/gradients.htm . How is your gradient defined? Perhaps with three colours? Or more?
snibgo's IM pages: im.snibgo.com
Re: How to create faded lines using "convert" commandline
Background image is black and there is no white.... I think I can use xc::black but I just want to create a line with blue color with the faded edges.. as same in the image..
Re: How to create faded lines using "convert" commandline
You can try this:
Code: Select all
Convert -size 800x20 xc:black ( -size 800x800 radial-gradient:cyan-transparent -crop 800x2+0+399 +repage ) -gravity center -composite -normalize combined.png
Re: How to create faded lines using "convert" commandline
I had to do something similar the other day. But instead of making a big radial gradient image I simply made a narrow tall one and then rotated it 90 degrees.
Re: How to create faded lines using "convert" commandline
@Bonzo Thanks alot .. It works great.. Can you explain me commands how it works? so that it will be helpful for me that I can create vertical lines as well and with different widths and heights of the faded line....
Re: How to create faded lines using "convert" commandline
Good to know it does what you want ummaga
convert
size and colour of the background
(
Size for the gradient canvas
Create a radial gradient going from cyan in the centre to transparent
Cut out a small rectangle 2px high from the centre of the gradient widthxheight+x_offeset+y_offset
Remove the excess canvas
)
Set the position of the composition to the centre
Overlay the gradient line onto the original background
Use the full range of colours - makes the cyan a bit brighter
Save
convert
size and colour of the background
(
Size for the gradient canvas
Create a radial gradient going from cyan in the centre to transparent
Cut out a small rectangle 2px high from the centre of the gradient widthxheight+x_offeset+y_offset
Remove the excess canvas
)
Set the position of the composition to the centre
Overlay the gradient line onto the original background
Use the full range of colours - makes the cyan a bit brighter
Save