Astrophoto Color Stretch

For those of you who have already discovered the joys of snapping pictures of the night sky this subject won’t come as a surprise. For the uninitiated though I will start with a few words of introduction. Landscape astrophotography (also known as: Nightscape photography or simply – some may even say erroneously – Astrophotography*) is the art of taking landscape pictures at night including (or containining exclusively) the starry sky. Long exposure times (up to 30 seconds without tracker, practically no limit with a sky tracking device) are usually used, high ISO (1600-3200+) settings, large apertures (f/2-f/1.8 seems to be the sweet spot) and wide angle lenses. One humble example of such photo is the one featured in this post (milky way shooting straight up from behind the Grand Perron peak, taken from the dam at Lac Emosson, Switzerland). Despite all these specially tuned variables it is not easy to obtain a truly glorious image straight out of the camera. At that point you usually resort to retrieving RAW files and adjusting them by hand in software like Darktable (a beast and my absolute favorite) or RawTherapee (strong but no masking support is disappointing). Efforts have been made previously to automatise this treatment and create a pipeline that would produce the best astrophotos possible without human intervention. One example of such pipeline is the rnc-color-stretch script by Roger N. Clark. Despite its strengths and established performance the script is written in a rather niche Davinci language and because of its structure is difficult to experiment with order and configuration of different processing steps. And thus we finally arrive at the original reason why I started writing this post which was to announce the creation of a restructured Python port of Roger N. Clark’s script – as well as the entire repository where I intend to put my future astrophoto-related scripts – All of that stuff is GPL for you to enjoy which I hope you will šŸ™‚ Cheers!

* Purists will say that “astrophotography” is a term reserved only for taking pictures of planets and DSOs (Deep Space Objects) typically involving use of a telescope with a digital body or a dedicated CCD camera attached.


  • hello, I’ve just found your port of rnc-color-stretch to python
    thank’s a lot
    I get it yesterday and modify it
    I port it to python 3.7 and scipy and scikit-image
    it works as well as original from Roger N Clark, far more faster and with 64 bit python works with heavy pictures

    • RaphaĆ«l,
      I have just started using RNC-Color-Strech using the old Davinci-based scripts, but would be very interested if you could share your work.
      Thanks in advance,

Leave a Reply

Your email address will not be published. Required fields are marked *