New stretching software: rnc-color-stretch released (free, open source)

I'm trying to install rnc-color-stretch on my Windows 7 machine and I can't find the download link for the latest version of davinci on the davinic web site.

All the "download davinci for windows" links lead back to a web page with only very old versions (2008-2011).

Can someone direct me to the proper link for the Windows download please?

Thanks,
Rudy

https://www.flickr.com/photos/rudypohl/
http://davinci.asu.edu/index.php?title=Download_For_Windows

is the most current, and is version 2.07 (Feb 2011).

It works fine, but the that windows version does not read 16-bit tiffs. Just convert to 16-bit float and it will works fine.

Roger
For some reason the program stopped working for me after a while. It crashes with tif files and cannot read png as well. Here is the cmd output

ad32f2eb1ec64fb0a00a556d83ec2e94.jpg.png

and yes, I export the picture as 16 bit png from photoshop. Tried all possible png options. Uninstalled and reinstalled davinci-no luck.

--
https://www.flickr.com/photos/aramgrg/
 
Last edited:
For some reason the program stopped working for me after a while. It crashes with tif files and cannot read png as well. Here is the cmd output

ad32f2eb1ec64fb0a00a556d83ec2e94.jpg.png

and yes, I export the picture as 16 bit png from photoshop. Tried all possible png options. Uninstalled and reinstalled davinci-no luck.
Try downloading the latest version of the stretching program.


Latest version is 0.96 from July 1, 2017. The libpng warning is strange though.

Roger
 
For some reason the program stopped working for me after a while. It crashes with tif files and cannot read png as well. Here is the cmd output

ad32f2eb1ec64fb0a00a556d83ec2e94.jpg.png

and yes, I export the picture as 16 bit png from photoshop. Tried all possible png options. Uninstalled and reinstalled davinci-no luck.
Try downloading the latest version of the stretching program.

http://www.clarkvision.com/articles/astrophotography.software/rnc-color-stretch/

Latest version is 0.96 from July 1, 2017. The libpng warning is strange though.

Roger
Thanks for reply. I get the same issue even with the latest version. The files that worked previously didn't work either, they make davinci crash. Any clue what I am experiencing?



f7303038ba5442d0910b0e6c1e415dad.jpg.png



--
 
For some reason the program stopped working for me after a while. It crashes with tif files and cannot read png as well. Here is the cmd output

ad32f2eb1ec64fb0a00a556d83ec2e94.jpg.png

and yes, I export the picture as 16 bit png from photoshop. Tried all possible png options. Uninstalled and reinstalled davinci-no luck.
Try downloading the latest version of the stretching program.

http://www.clarkvision.com/articles/astrophotography.software/rnc-color-stretch/

Latest version is 0.96 from July 1, 2017. The libpng warning is strange though.

Roger
Thanks for reply. I get the same issue even with the latest version. The files that worked previously didn't work either, they make davinci crash. Any clue what I am experiencing?

f7303038ba5442d0910b0e6c1e415dad.jpg.png

--
https://www.flickr.com/photos/aramgrg/


I'll need a copy of the image to diagnose the problem. Please contact me by email and I'll work on it.

Roger
 
Just sent an email to clarkvision.com address. Thanks again.
 
Hi Roger,

I've read in the documentation of your tool that you also hit the issue of CFA (Bayer) induced 'plotchy artifacts' and recommend either 'exposure dithering', 'raw denoising' or '-setmin' to fix the problem.

I have an image where none seem to help to the extent I would like so I looked around a little bit and eventually came across this paper: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/267_lowlight.pdf

This seems very interesting in fighting the 'plotchy artifacts' - as they call it - and actually present evidence that the phenomena is caused by the demosaicing part of the raw conversion process.

My question is if you have any experience with/it or have you seen an actual implementation of the algorithm they propose.

Regards,

Doma
Yes, the color blotchiness is definitely due to demosaicking algorithms. That is well known. You can tune the noise reduction in photoshop/lightroom during raw conversion. Rawtherapee has more advanced algorithms and should do a better job (more difficult program to understand). Another way people mitigate the problem is by dithering--shifting the field of view a few pixels between frames.

But astrophotographers usually push the limits trying to extract ever fainter detail until they hit a wall like this problem. Then the setmin parameter can mitigate the problem some.

Roger
Hi,

thank you. I actually use Rawtherapee.

I will try a convolution network based approach, which seems pretty close to the approach outlined in the paper. Namely this one: https://groups.csail.mit.edu/graphics/demosaicnet/

Doma
I finished evaluating the convolution network based raw conversion tool and I can tell you it gives fantastic results. Key advantages are:

- Incredibly low and very smoothly distributed noise in the low signal areas

- Fantastic work on color fringes/CA. It removed all color fringes from around stars

I combined its results with "cosmetic correction" and then stitched - got very good results.

You might want to try it it is available from here: https://github.com/mgharbi/demosaicnet It takes some effort to get it working but is well worth it.

Doma
 
Last edited:
Anyone here using rnc-color-strech on Ubuntu?

I tried to compile the latest davinci on ubuntu 17.10 but it fails.

Version 2.07 is working with color-strech but the output file is not written any more.

On windows 7 now davinc stops working to giving runtime errors.
 
Anyone here using rnc-color-strech on Ubuntu?

I tried to compile the latest davinci on ubuntu 17.10 but it fails.

Version 2.07 is working with color-strech but the output file is not written any more.
Davinci 2.07 works just fine for the stretch program. Newer versions will give the same output.

Did you include the obase flag for the output base file name? If not, then the default file name is written and it will not overwrite an existing file. Every run needs a unique base file name as the program will not overwrite an existing file.
On windows 7 now davinc stops working to giving runtime errors.
This is likely due to running out of memory. Davinci on windows is a 32-bit application and memory limits are hit at around 24 megapixels. The latest version of the stretch, 0.97, reduces the memory needed and memory limits are hit between 30 and 35 megapixels.

In macs and linux, the inly limit is your machine capabilities.

Roger
 
Anyone here using rnc-color-strech on Ubuntu?

I tried to compile the latest davinci on ubuntu 17.10 but it fails.

Version 2.07 is working with color-strech but the output file is not written any more.
Davinci 2.07 works just fine for the stretch program. Newer versions will give the same output.
Yes, but since 17.10 the file is simply not written. so I tried to compile the latest SVN version.

I changed the default name in your script to to test it. Everything runs without errors but no output file????
On windows 7 now davinc stops working to giving runtime errors.
This is likely due to running out of memory. Davinci on windows is a 32-bit application and memory limits are hit at around 24 megapixels. The latest version of the stretch, 0.97, reduces the memory needed and memory limits are hit between 30 and 35 megapixels.
Ok that is the reason on the vm, my image is now 24mbit and not 16mbit.

Tried it now it runs till the end but also does not the generate a-image file

I will try 0,97. On Linux I will check the memory limits but I think this is not the problem.

Have you ever tried to convert your script to python/pil/numpy ?

I look a bit into it but I do not know much about davinci and if you use some special function apart of the matrix manipualtion and Image read/write.

Martin
 
Last edited:
Anyone here using rnc-color-strech on Ubuntu?

I tried to compile the latest davinci on ubuntu 17.10 but it fails.

Version 2.07 is working with color-strech but the output file is not written any more.
Davinci 2.07 works just fine for the stretch program. Newer versions will give the same output.
Yes, but since 17.10 the file is simply not written. so I tried to compile the latest SVN version.

I changed the default name in your script to to test it. Everything runs without errors but no output file????
On windows 7 now davinc stops working to giving runtime errors.
This is likely due to running out of memory. Davinci on windows is a 32-bit application and memory limits are hit at around 24 megapixels. The latest version of the stretch, 0.97, reduces the memory needed and memory limits are hit between 30 and 35 megapixels.
Ok that is the reason on the vm, my image is now 24mbit and not 16mbit.

Tried it now it runs till the end but also does not the generate a-image file

I will try 0,97. On Linux I will check the memory limits but I think this is not the problem.

Have you ever tried to convert your script to python/pil/numpy ?

I look a bit into it but I do not know much about davinci and if you use some special function apart of the matrix manipualtion and Image read/write.

Martin
Show us the last 50 or so lines of the program output, including the point where it fails.
 
Ok here we go:

davinci
loading history
dv> version()
"daVinci Version #2.10"

davinci -f rnc-color-stretch-v0.97.sh ~/Dokumente/bilder/dark/enfuse/enfuse-01.tif

.....

subtract 38060.0 from red to make red sky align with zero reference sky: 4096.0
subtract 39272.0 from green to make green sky align with zero reference sky: 4096.0
subtract 35748.0 from blue to make blue sky align with zero reference sky: 4096.0

now set the RGB sky zero level to 4096.0 4096.0 4096.0 DN out of 65535

root stretched image, power exponent= 0.166667 root iteration 1
scaled image stats, before color recovery, sky adjust pass 1:
RED: min=0 max=65535 mean=17730
GREEN: min=0 max=65535 mean=12325
BLUE: min=0 max=65535 mean=17523

computing RGB histograms on root stretched image and smoothing the histograms, pass 2, root iteration 1

Histogram peak, after root stretch, root iteration 1:
image histogram: DN Number of pixels in peak histogram bin
red: 17704 4750.986816
green: 10668 3453.402588
blue: 18744 5452.288086

histogram dark sky level on root-stretched image ( 6.0 % of max)
DN Number of pixels in histogram bin
red: 17108 285.059204
green: 10668 207.204147
blue: 18149 327.137268

subtract 13012.0 from red to make red sky align with zero reference sky: 4096.0
subtract 6572.0 from green to make green sky align with zero reference sky: 4096.0
subtract 14053.0 from blue to make blue sky align with zero reference sky: 4096.0

now set the RGB sky zero level to 4096.0 4096.0 4096.0 DN out of 65535

root stretched image, power exponent= 0.166667 root iteration 1
scaled image stats, before color recovery, sky adjust pass 2:
RED: min=0 max=65535 mean=7215
GREEN: min=0 max=65535 mean=6993
BLUE: min=0 max=65535 mean=5316

image stats after root stretch, bottom adjusted: min=0.000000 max=65535.007812 mean=21265.089844

root stretched image, power exponent= 0.166667, scaled image stats, before color recovery:
RED: min=0 max=65535 mean=7215
GREEN: min=0 max=65535 mean=6993
BLUE: min=0 max=65535 mean=5316

computing image ratios for color analysis
setting limits for color correction

Color ratio images after limit set 0.200000 to 1.000000
Color ratio: grratio = min= 0.200 max= 1.000 mean= 0.639
Color ratio: brratio = min= 0.200 max= 1.000 mean= 0.683
Color ratio: rgratio = min= 0.200 max= 1.000 mean= 0.824
Color ratio: bgratio = min= 0.200 max= 1.000 mean= 0.816
Color ratio: gbratio = min= 0.200 max= 1.000 mean= 0.700
Color ratio: rbratio = min= 0.200 max= 1.000 mean= 0.749

computing intensity dependent color correction
color correction intensity range factor: image stats: min=0.230769 max=1.000000 mean=0.644767
color correction cfe range factor: image stats: min=0.276923 max=1.200000 mean=0.773720

Color ratio images after factors applied
Color ratio: grratio = min= 0.105 max= 1.000 mean= 0.764
Color ratio: brratio = min= 0.105 max= 1.000 mean= 0.808
Color ratio: rgratio = min= 0.105 max= 1.000 mean= 0.922
Color ratio: bgratio = min= 0.109 max= 1.000 mean= 0.917
Color ratio: gbratio = min= 0.109 max= 1.000 mean= 0.820
Color ratio: rbratio = min= 0.105 max= 1.000 mean= 0.866
computing 6 intermediate possible image sets for color correction
starting signal-dependent color recovery
starting line 1 of 4028
line 1 af[3015,iy,1] orig-sky RGB= 9233 7843 8524
line 1 c[3015,iy,1] corrected RGB= 5484 5689 7089
starting line 1001 of 4028
line 1001 af[3015,iy,1] orig-sky RGB= 12182 9960 9555
line 1001 c[3015,iy,1] corrected RGB= 12834 9461 8752
starting line 2001 of 4028
line 2001 af[3015,iy,1] orig-sky RGB= 14059 12342 10845
line 2001 c[3015,iy,1] corrected RGB= 16768 13969 11411
starting line 3001 of 4028
line 3001 af[3015,iy,1] orig-sky RGB= 13522 9960 10071
line 3001 c[3015,iy,1] corrected RGB= 15691 9857 10016
starting line 4001 of 4028
line 4001 af[3015,iy,1] orig-sky RGB= 9233 7843 8524
line 4001 c[3015,iy,1] corrected RGB= 5484 5689 7089
color recovery complete

computing RGB histograms on root stretched image and smoothing the histograms

Histogram peak, after root stretch, color corrected:
image histogram: DN Number of pixels in peak histogram bin
red: 13126 3462.753662
green: 8076 4513.583984
blue: 7387 5084.537598

histogram dark sky level on root-stretched image ( 6.0 % of max)
DN Number of pixels in histogram bin
red: 12535 207.765213
green: 7535 270.815033
blue: 6790 305.072235

now set the root-stretched sky level to 4096.0 DN out of 65535
subtracting 3439.000000 from R, G, and B

root stretched image, power exponent= 0.166667, scaled image stats, after color recovery:
RED: min=0 max=65535 mean=4928
GREEN: min=0 max=65535 mean=3836
BLUE: min=0 max=65535 mean=2712

stretched image stats, final image:
RED: min=0 max=65535 mean=4928
GREEN: min=0 max=65535 mean=3836
BLUE: min=0 max=65535 mean=2712

output image dimnsions: 6030 4028 4
writing 16-bit results image a-stretched-image.png
NOTE: image is 0-32765. You will need to scale it 2x, e.g. with levels tool in photoshop
With levels tool in photoshop or other editor, change the right slider from 255 to 128
then save as 16-bit tiff for further processing
writing 8-bit results jpeg image a-stretched-image.jpg

XXXXXXXXX

But no a-stretched-image in the current directory.
 
Last edited:
output image dimnsions: 6030 4028 4
writing 16-bit results image a-stretched-image.png
The key to the problem is here: the 4 means the image is a 4-channel image, not 3 channel RGB. Is the 4th channel a luminance channel?

It is interesting that davinci read the 4-channel image but will not write one, nor issue an error message.

So I added a check in the stretch program, version 0.975, which you can download here:


Please try this image with the new program. It should stop right after reading the image and issue an error message about not being a 3 band image. Let me know if the test doesn't work.

So convert the image to a basic RGB 3-color image and it should then work.

Roger
 
Thanks, not it works again. I do not know the source of the 4th channel, enfuse or gimp intruded it.

Now I must remove the light pollution. will experiment with gimp to further enhance the image.

Thanks for your help.

a460cfd1f84848a984a1c28f92392401.jpg
 
Thanks, not it works again. I do not know the source of the 4th channel, enfuse or gimp intruded it.

Now I must remove the light pollution. will experiment with gimp to further enhance the image.

Thanks for your help.

a460cfd1f84848a984a1c28f92392401.jpg
The image above indicates you need a flat field correction. That should be done first before any stretching or light pollution subtraction.
 
First, sorry for reviving a dead thread, but I haven't found the information I need in 3 hours of scouring the net.

I just wanted to check to see if this product is still functioning? I have read through all these threads and tried several different approaches and can't seem to get it to work, even with the sample file on ClarkVision.

I keep ending up with a 1x1 resolution image that contains no data, if it works at all.

Since 2.18 is no longer available I was using the latest release on Davinci's site for windows. Would I have better luck running the Ubuntu version?

Tried both a 16 bit TIF and a 16 bit PNG (best I could tell it was 16 bit, it was difficult to find a way to convert the TIF to PNG and maintain that.

I am hoping this still functions as it looks like exactly what I need to bring out the colors in my astro photos like I am wanting.

Logan
 
First, sorry for reviving a dead thread, but I haven't found the information I need in 3 hours of scouring the net.

I just wanted to check to see if this product is still functioning? I have read through all these threads and tried several different approaches and can't seem to get it to work, even with the sample file on ClarkVision.

I keep ending up with a 1x1 resolution image that contains no data, if it works at all.

Since 2.18 is no longer available I was using the latest release on Davinci's site for windows. Would I have better luck running the Ubuntu version?

Tried both a 16 bit TIF and a 16 bit PNG (best I could tell it was 16 bit, it was difficult to find a way to convert the TIF to PNG and maintain that.

I am hoping this still functions as it looks like exactly what I need to bring out the colors in my astro photos like I am wanting.

Logan
I tried it a couple months ago, and it was probably beginner error but the only way I could get a PNG to work was to take a TIFF and export it from GIMP as a 16 bit PNG (from what I remember it didn’t explicitly say 16 bit in the UI, there were some advanced options). If I used Lightroom or Photoshop it would error out every time.
 
Since 2.18 is no longer available I was using the latest release on Davinci's site for windows. Would I have better luck running the Ubuntu version?
I just had to rebuild my PC and with a bit of digging managed to find 2.18 for Windows. It's still on the site, it's just not an advertised link anymore : http://mars.asu.edu/~rswinkle/Davinci-2.18-Setup.exe

Tested and working for me.

Hope that helps people.

Regards,

Ollie
 
SO, I’m a beginning astrophotographer, and I’m realy loving learning and have captured a few decent photos and have been trying to learn processing. I came across Clarkvision and all the articles about rnc color stretch and I’d love to figure out how to install/use it, but the whole install process might as well be in French. literally might as well stare at the screen and strike myself in the face with a hammer. Is there instructions for a lay person to install this? or has anyone made an executable installation for Mac? I have no idea what to do with usr/local/bin, what it is, how to install something there, or how to apply it to my life. :)

Feeling like i might just be out of luck on this one. Or maybe have to go get an associates in computer science first haha

Any help would be great

thanks

Aaron
 

Keyboard shortcuts

Back
Top