Sunset Gradients
Home
Creating gradients from sunsets
Medium: Javascript
Gradient #4
Gradient #1
How it works
1) Find a nice photo of a sunset, or even better, take one yourself.
2) The aim here is to find the sun in the image. A good place to start is to extract a mask of only the brightest pixels, which is a bit messy but does remove a lot of the non-sun regions.
3) The noisy bits can be removed using an 'erode' operation, which removes small regions from the mask.
4) The sun can now be located at the center of the remaining white pixels in the mask.
5) Finally, all the pixels in the column that the sun is in are extruded along the x axis to form the gradient.
Gradient #5
Gradient #6
Gradient #7