0
I have an image and I want to make it lighter at the top fading to no effect at the bottom. So if the image was a solid green to begin with, at the end it would look like a gradient from light green to green.
I thought I could do something like this (copmositing a white block over the top of the image using a gradient as a mask):
convert a.jpg \( +clone -fill white \) \
\( +clone gradient:white-black \) \
-composite out.jpg
Or this ('colorize' an image with a gradient that fades to transparent)
convert a.jpg \( +clone 'gradient:black-rgba(0,0,0,0)' \) \
-colorize 50% out.jpg
…but neither works.
how would you apply it to a masked region like a circle of radius R, while leaving the rest of the image outside the circle transparent? – μολὼν.λαβέ – 2017-12-05T01:37:29.330
You could do it with maths and ternary operators but it would get very complex. Imagemagick probably has a way to draw a circle. So use that inside the
– artfulrobot – 2017-12-05T12:50:52.670\( ... \)
bit to create a circle. This case should be a new question really.