~/Create Image Gradient Art with ImageMagick One Liner

Feb 19, 2022


To generate gradient art with ImageMagick, a single line command is enough.

For a horizontal gradient from black to white with 800 by 400 pixels:

1
convert -size 800x400 gradient:black-white gradient.png

For a vertical gradient from red to blue:

1
convert -size 800x400 gradient:red-blue gradient.png

To overlay the gradient on an existing image, use composite:

1
composite -blend 50 gradient.png input.jpg result.png

Quick adjustments like changing orientation or colors can be handled by replacing color names or size. More gradient options are available.

Tags: [imagemagick]