Jump to content
UltravioletPhotography

How to make a TriColour image, my method


Stefano

Recommended Posts

Andy Perrin

Neat! Stefano, both the visible and the color-UV image look underexposed to my eye - you could brighten both a lot, I think.

Link to comment

Yes, probably they would look a bit better one stop brighter or so. That would overexpose the paper tissue I think, but that was just for the color calibration.

 

I think that a 50% or even 25% PTFE reflectance standard would work better.

Link to comment
Andy Perrin

Just the photoshop autocontrast did a nice job and the paper only overexposed in a couple of spots.

 

 

somma755-1.jpg.27a8001a78ab1f0bd8670096cf2b87f9.jpg

Link to comment

Yes, that looks better. Here's what I get by brightening them by 50% (I think it's a percentage) in Window's Photo editor:

 

UV:

815019874_somma755(2).jpg.264d08d196f66c1fc5b7d817f67f27c6.jpg

 

VIS:

1436106497_IMG_0353(2).JPG.8637ebba772306df35ecb5a9cd4afc54.JPG

 

I worked with the .tif file for the UV image to reduce artifacts.

Link to comment
Andy Perrin

Yeah, you should increase the contrast on the UV image now to get it in the same realm as the visible. Your "blacks" are not very black. Can also be done by adjusting the black point on the histogram.

Link to comment

The problem with my blacks is the noise in the 310 nm image, which shifts them to a dark blue. I usually take as many as 20 photos at 310 nm to average them, but the noise I have isn't random up/down fluctuations, I think it's only up (it only brightens the pixels). The only way is to subtract a dark gray image from the 310 nm channel to bring the blacks back where they should be.

Link to comment
Andy Perrin

No, you can just shift the final image and it looks fine! I'm not talking about the color, just the contrast. The shadows here still have the blue look, but the contrast is adjusted better.

 

 

somma755-1.jpg.27a8001a78ab1f0bd8670096cf2b87f9.jpg.81ddacaf7392993bb770e996bc83e06b.jpg

 

 

 

Quote

I usually take as many as 20 photos at 310 nm to average them, but the noise I have isn't random up/down fluctuations, I think it's only up (it only brightens the pixels). 

Don't take a mean, take a MEDIAN. Medians are much better at rejecting outliers. If you use one of the astro programs (or your own script even), it's easy to find the median image. I use the Long Exposure Stacker on the Mac, but I think the PC software also allows medians.

 

Link to comment

Yes, it does look better. It looks more "normal".

 

One day I really should think about buying one of those MaxMax monochrome cameras that are much more sensitive to UVB. For now, this is the best my setup can do (which is not bad, anyway).

Link to comment
7 minutes ago, Andy Perrin said:

Did you see the second comment about using the median? Even with current setup, that will help.

No, I didn't. I think I might even write a MATLAB code for that, it shouldn't be too difficult. I will surely try this.

Link to comment
Andy Perrin

It MATLAB, make a 3D matrix of uint16's with the photos and then you should use 

median(yourStack, 3) to take median along the 3rd dimension. Then save it with imwrite.

Link to comment

I wrote this code, it does work (although the median acts weird), but I don't see much difference between the mean and the median. The mean is slightly darker.

 

I had to make a 4-dimensional matrix.

 

clear
clc

n = 23; %number of images

MyStack = zeros(3476, 5208, 3, n, 'uint16');
MyStack(:, :, :, 1) = imread('1.tif');
MyStack(:, :, :, 2) = imread('2.tif');
MyStack(:, :, :, 3) = imread('3.tif');
MyStack(:, :, :, 4) = imread('4.tif');
MyStack(:, :, :, 5) = imread('5.tif');
MyStack(:, :, :, 6) = imread('6.tif');
MyStack(:, :, :, 7) = imread('7.tif');
MyStack(:, :, :, 8) = imread('8.tif');
MyStack(:, :, :, 9) = imread('9.tif');
MyStack(:, :, :, 10) = imread('10.tif');
MyStack(:, :, :, 11) = imread('11.tif');
MyStack(:, :, :, 12) = imread('12.tif');
MyStack(:, :, :, 13) = imread('13.tif');
MyStack(:, :, :, 14) = imread('14.tif');
MyStack(:, :, :, 15) = imread('15.tif');
MyStack(:, :, :, 16) = imread('16.tif');
MyStack(:, :, :, 17) = imread('17.tif');
MyStack(:, :, :, 18) = imread('18.tif');
MyStack(:, :, :, 19) = imread('19.tif');
MyStack(:, :, :, 20) = imread('20.tif');
MyStack(:, :, :, 21) = imread('21.tif');
MyStack(:, :, :, 22) = imread('22.tif');
MyStack(:, :, :, 23) = imread('23.tif');

%Median
M = median(MyStack, 4);
M = mean(M, 3)./255; %otherwise it doesn't work

%Mean
G = mean(MyStack, 4)./255;

imwrite(M, 'Median.tif');
[Median] = imread('Median.tif');
imshow(Median);

imwrite(G, 'Mean.tif');
[Mean] = imread('Mean.tif');
imshow(Mean);

 

Here I used 23 images as a test.

Link to comment
Andy Perrin

You can do the imreads in a for loop using sprintf to make the file name strings. The mean isn't necessary. you should use "squeeze" to get it back to 3D. 

 

for j=1:n
      name = sprintf('%i.tif', j);
      MyStack(:,:,:,j) = imread(name);
end

 

Link to comment

Thanks. I still have to figure out how to properly squeeze my matrix, but the for loop for loading images is very useful.

 

ImageStacker has also an interesting setting, which darkens the image by taking only the darkest pixels (there is also an opposite setting). Sometimes the image is darkened a lot, especially if you use a lot of images (and I don't know if it really is the best thing to do), but contrast is often improved. Assuming the noise only adds brightness, it should be the best way of processing images.

Link to comment
  • 1 year later...

Photoshop procedure

 

Since I have plans of doing color images like this (based on two or more monochrome images with varying filtering), I wanted to find a way of doing it in Photoshop, since that's my primary photo-editing software. After a bit of testing and also asking in the Adobe community, I have found a way to do this which isn't too complicated. This method is based on using the three primary colors; RGB.

 

1) Start by editing and saving each monochrome image as JPG or TIF, if you shoot in raw.

2) For each (opened) image, go to Image -> Adjustments -> Channel Mixer. Then zero out two of the channels, so only one is left.

    Save each image, which is now in either purely Red, Green or Blue. If you want to use other colors, then this step must be modified accordingly.

3) Then go to: File -> Scripts -> Load Files into Stack. Select the (single) color images. Remember to select Attempt to Automatically to Align Source Images.

4) In the Layers panel, select all layers. Below the "Kind" drop-down menu, there is a second: click and select Screen.

    Now you have an RGB image based on three layers. If needed, these can be edited further individually.

5) Go to Layer -> Flatten Image. Save the image with an appropriate name and you are done!

 

Link to comment
Andy Perrin

Lars, that would work but it's more complicated than needed! You can literally click on a channel of each monochrome image and select-all, copy, and paste into the appropriate channel (R, G, or B) in a new document of the same pixel dimensions.

Link to comment
1 hour ago, Andy Perrin said:

Lars, that would work but it's more complicated than needed! You can literally click on a channel of each monochrome image and select-all, copy, and paste into the appropriate channel (R, G, or B) in a new document of the same pixel dimensions.

That's right. That method was actually also suggested, but won't work if one (or more) of the images is slightly moved while changing filters, which I expect is a common practical problem.

Link to comment
Andy Perrin

Yeah, it happens if you filter change. Stefano’s method in this thread avoids the issue by changing light source rather than filter. 

Link to comment
Stefano

Filters are needed outdoors or when a material isn't simply absorbing and reflecting light, for example in the case of fluorescence. It is probably rare to encounter materials with significant fluorescence, but filters could be better in general (for example if you want to see colors under a broadband illumination, such as illuminant D65, and fluorescence might play a role).

Link to comment
20 minutes ago, Stefano said:

Filters are needed outdoors or when a material isn't simply absorbing and reflecting light, for example in the case of fluorescence. It is probably rare to encounter materials with significant fluorescence, but filters could be better in general (for example if you want to see colors under a broadband illumination, such as illuminant D65, and fluorescence might play a role).

Thanks. For my use cases, I rely on filters only, so aligning the images may be needed from time to time.

Link to comment
lonesome_dave

Thanks Lars. I stumbled upon a similar procedure using Photoshop for my mis-aligned outdoor tricolors but your description makes it clear for folks like me who are using sub-optimal gear.

Link to comment
12 hours ago, lonesome_dave said:

Thanks Lars. I stumbled upon a similar procedure using Photoshop for my mis-aligned outdoor tricolors but your description makes it clear for folks like me who are using sub-optimal gear.

You are welcome. Happy to know the post was helpful. 

Link to comment

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...