Hello.

I would like to write (based on my own, not-ready yet engine. ) a little program that displays our Earth, stars, and generally space. I've already coded the basics (the starfield, displaying Earth), but I'd like to know how do I achieve the effect similar to the one in this picture?

I thought of using border detection algorithms, I've heard there are a few of them. But maybe there is another solution? Please explain it to me.

Greetings.