PixInsight Forum (historical)

PixInsight => Tutorials and Processing Examples => Topic started by: Jim_ on 2012 October 29 07:54:48

Title: How do I combine two master lights
Post by: Jim_ on 2012 October 29 07:54:48
I searched the forums but couldn't find an answer.
I have two light frames I want to combine.
They're resized and aligned now, but how do I combine them???

Jim
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 29 07:57:36
Hi,

what do you mean with 'combine'? You want to average them? Assign each to a channel?
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 October 29 08:00:53
Hi,

what do you mean with 'combine'? You want to average them? Assign each to a channel?

I guess average them would the best way to put it.
In PS you just need to copy and paste one image on top of another one and adjust the opaqueness to taste and then flatten the image.
I can't seem to find anything like this in PI...I'm know it's there, I just don't know what it would be called.

Jim
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 29 08:12:35

Hi,

well there are at least two ways:

- use pixel math to add your images and then divide them, something like this: (img1 + img2) / 2
- use ImageIntegration

I hope you understand that 'combine' can also refer to combining monochrome lights into an RGB image. That is done differently. That's why I needed that clarified first.
Title: Re: How do I combine two master lights
Post by: mschuster on 2012 October 29 08:22:00
Pixel math works fine for layering but it is not easy to use. It also has no easy preview capability to help adjust weighting parameters. IMO lack of layering is a weakness of PI. For example I often want to apply a HDRWT but don't want it applied "full strength". So I apply the process to a copy and then blend the original with the result of the process in pixel math. Very inconvenient. If there is an easy way to layer in PI please post, maybe I am missing something.
Mike
Title: Re: How do I combine two master lights
Post by: pfile on 2012 October 29 08:43:00
yes, make a luminance mask with the desired strength and have it active when you apply the HDRWT (or any other process for that matter.)

this is the 'right' way to do it in PI. i can see why you are frustrated with having to do it with pixelmath.
Title: Re: How do I combine two master lights
Post by: mschuster on 2012 October 29 09:01:36
Thanks that makes sense. If I want to do a 50%/50% blend what is the best way to make the mask?
Mike
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 29 09:12:16
in pixel math say "0.5" and create a new image. I can't try it right now but pretty sure that will get you a uniform 0.5 image. I can see how it would be useful to have a linear 'power' slider for processes. I haven't ever needed it but that doesn't mean it's not useful of course :-)

I suspect at least some processes where a power slider makes sense already have such a control even if it's not called that.
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 October 29 10:09:10

Hi,

well there are at least two ways:

- use pixel math to add your images and then divide them, something like this: (img1 + img2) / 2
- use ImageIntegration

I hope you understand that 'combine' can also refer to combining monochrome lights into an RGB image. That is done differently. That's why I needed that clarified first.


Thanks Sander,

Well, I did get that to work.
It seems like a complex way of adding data from one image session to another one.
ImageIntegration wouldn't work with less than three images.


yes, make a luminance mask with the desired strength and have it active when you apply the HDRWT (or any other process for that matter.)

this is the 'right' way to do it in PI. i can see why you are frustrated with having to do it with pixelmath.


You lost me there  = ))
I'm still new with PI so everything is a learning experience.

Jim

Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 29 10:13:49
Quote
Well, I did get that to work.
It seems like a complex way of adding data from one image session to another one.
ImageIntegration wouldn't work with less than three images.

Perhaps it's complex but it's very flexible. You can also add 3 or 4 of 8 images that way. It also takes only a few seconds so it's not -that- complex :-)

To be fair I'm not sure why you'd want to combine lights that way anyway, just pile all your lights into imageintegration and get the result in one shot. Can you explain what workflow leads to having 2 stacked lights that need combining? Whenever I have lights from multiple sessions I stack the whole thing.

I didn't know ImageIntegration requires 3 images at least, thanks for letting me know.
Title: Re: How do I combine two master lights
Post by: topboxman on 2012 October 29 10:14:31
You can try use ImageIntegration by including the same image twice. Using the same image twice should not be any different than using once.

Peter
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 29 10:24:35
In that case you should include each image twice otherwise one image will have double the weight of the other one and it won't be an average.

Good trick though :-)
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 October 29 10:37:00
Quote
Can you explain what workflow leads to having 2 stacked lights that need combining? Whenever I have lights from multiple sessions I stack the whole thing.

Sure, in this case I just finished modding a 350D and wanted to combine it with an image from my 60Da.
I'm more playing around trying to learn PI better.

Thanks for the help all
Jim
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 29 10:49:41
Ah, more useful information :-)

You may have to experiment with different weights for each image to get the best result. Averaging two lights to increase SNR only makes sense when they are from the same distribution. So your cameras would need to have the same light response for that to be true. A bit unlikely I'm sure you'll agree. If you average two numbers that are not from the same Poisson distribution you simply get the average and there's really no telling if that average is 'better' or not. If one image has worse SNR than the other the combined image will be worse than the better of the originals.

I am suspicious of the benefits of combining unrelated images. Ask me about HaRGB and other combinations some day :-)

I recommend you keep an honest eye on the result and see if the combined image is really better than either one of the originals. Experiment with weights in the pixel math formula. Simply multiply one image with a factor to weigh it more or less. You actually don't need to divide by two. Simply check the 'rescale' box in pixelmath. Addition is the same as averaging from an SNR perspective.
Title: Re: How do I combine two master lights
Post by: pfile on 2012 October 29 13:17:44
Thanks that makes sense. If I want to do a 50%/50% blend what is the best way to make the mask?
Mike

i'm not sure this is any easier than pixelmath, but maybe. if you want to apply any process at a 50% strength (or any strength) then you can just create an image with all pixel values = 0.5 and use that as a mask.

generally though i like to do the HDR transforms and LocalContrastEqualization only on the high-SNR parts of an image. so i just extract the Lightness from the image, then adjust the histogram so that the background is clipped off and the high-SNR parts are pretty bright (like maybe 0.75 or so). then i'll smooth the mask by removing the first 4 wavelet scales with AtrousWavelets and then maybe touch up the histogram again. i suppose you could do the wavelets first and then do the HT, though.

so then i apply this new L image as the mask, and then run the contrast enhancement stuff. seems to work pretty well.

Jim_, i think this answers your question also?

masks are pretty fundamental in PI; they are the most basic way of controlling what a process does to what parts of your image.
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 October 29 13:27:30

[/quote]
 if you want to apply any process at a 50% strength (or any strength) then you can just create an image with all pixel values = 0.5 and use that as a mask.
[/quote]

The mask part is no problem.
They're actually almost easier to make in PI than PS.

How would I create an image with varying pixel values?
I've got PI opened and been searching but can't find anyway to do it.
Title: Re: How do I combine two master lights
Post by: pfile on 2012 October 29 13:39:54
if your image is mono, jut clone it by dragging the top tab in the view to the desktop, then stretch and smooth it as i've described above.

if your image is color, extract the lightness (Image > Extract > Lightness ) or click the 5th icon over on the toolbar (kind of an RGB gradient with a small grey square overlaying the corner), then stretch/smooth.

there isn't really any way to 'paint' a mask in PI.
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 29 13:56:55
Right, when I mask it's never to attennuate the process everywhere. It's always some mask to hide certain features. My saturation curve is almost always masked with a processed extracted L like Rob described. I generally don't worry about the wavelet smoothing but it's a good trick.
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 October 29 14:00:38
pfile,

So you really can't set a percentage for the image then?
I understand about changing the mask with the histogram, but you mentioned being able to apply the process at 50% by creating an image with all pixel values = .5.
Is that done in pixel math?
Title: Re: How do I combine two master lights
Post by: pfile on 2012 October 29 16:09:03
right, if you create an image of the same dimensions as your target image, and set every pixel in that new image to 0.5, and then use the new image as a mask for the target image, you will apply any process to the image at 1/2 strength as long as the mask is applied and active.

i think it got lost upthread, but sander replied that if you go into pixelmath, set the RGB/K expression to simply "0.5" (but without quotes), then in the dropdown set the mode to "create new image" and "greyscale" and drag the triangle onto your image, it will create a new image with all pixels set to 0.5.

Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 October 29 18:03:24
hahahahahahaha

You're right...sorry sander I missed you're post.
I didn't know there was an extra drop down box in pixel math.
Very cool though.
I can't wait to play around with this later...

Thanks for putting up with a newbie   = ))

Jim
Title: Re: How do I combine two master lights
Post by: pfile on 2012 October 29 18:12:23
no problemo... here's a screenshot...

Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 29 18:23:18
No problem Jim, we're happy you're trying PI.
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 October 30 13:37:39
I'm now a full fledged PI member.
I purchased it about a week ago   = ))
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 October 30 14:41:43
Great!
Title: Re: How do I combine two master lights
Post by: Juan Conejero on 2012 November 06 06:57:24
Quote
...IMO lack of layering is a weakness of PI...

Don't take this as an official announcement, but see below... :)

(http://forum-images.pixinsight.com/1.8.0-preview/Layers/Layers-tn.jpg) (http://forum-images.pixinsight.com/1.8.0-preview/Layers/Layers.jpg)
Click to enlarge (http://forum-images.pixinsight.com/1.8.0-preview/Layers/Layers.jpg)
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 November 06 07:04:55
And thus it begins....
Title: Re: How do I combine two master lights
Post by: resonance on 2012 November 06 07:23:14
Ok...now I want to see who will continue to say that photoshop is better ;)
Title: Re: How do I combine two master lights
Post by: Nocturnal on 2012 November 06 07:56:39
Ok...now I want to see who will continue to say that photoshop is better ;)

I've never really paid attention to that sentiment :-) PI was better when it came out of beta 6 years ago.
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 November 06 09:33:19
Quote
...IMO lack of layering is a weakness of PI...

Don't take this as an official announcement, but see below... :)



SWEET!!!!!
Title: Re: How do I combine two master lights
Post by: Harry page on 2012 November 06 15:08:49
Hi

So Juan , when do you sort of plan to work this into a release  :D 8)

Harry
Title: Re: How do I combine two master lights
Post by: pfile on 2012 November 06 15:35:36
the window title said "1.8" so... soon?
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 November 06 19:01:38
Wait....Wait....Wait...that's all I ever do    :D
Title: Re: How do I combine two master lights
Post by: Josh Lake on 2012 November 07 08:07:26
Quote
...IMO lack of layering is a weakness of PI...

Don't take this as an official announcement, but see below... :)


Whoa, Juan, this is big news! I just thought you were philosophically opposed to the Layers model of astro-processing... I am too, in a way, but I can think of a number of great uses for this functionality.
Title: Re: How do I combine two master lights
Post by: Philippe B. on 2012 November 07 08:12:50
Hi Juan

Hope to see that very soon  O0

Indeed, very nice preview
Title: Re: How do I combine two master lights
Post by: pfile on 2012 November 07 08:39:50
i'm not sure there's any philosophical opposition to layers per se, i think it's the idea of creating arbitrary masks (by painting) and enhancing structures/colors  using those masks. in theory this can already be done in PI, it's just harder than PS due to the lack of painting tools.

i think the concept of layers as a real-time processing pipeline is pretty powerful. if the day comes when each layer can be a process and a mask, PI will become more powerful than you could possibly imagine (to quote obi-wan)
Title: Re: How do I combine two master lights
Post by: bitli on 2012 November 09 05:42:19
PI -> Photoshop Inside ?

  :)

-- bitli

Title: Re: How do I combine two master lights
Post by: Juan Conejero on 2012 November 10 04:13:40
We don't have anything against layers. The layers paradigm has always been an interesting and powerful UI approach for document-oriented environments, such as CAD applications and drawing applications. In an object-oriented environment such as PixInsight, layers can also be useful, and even funny, because they allow for some kind of interaction that is more difficult to implement with separate images. I hope a layers tool will make PixInsight more appealing to those who are heavily accustomed to the layers paradigm, and hence a more competing product.

The only problem with layers is in the way they are being used with other applications. Unfortunately, layers are now associated with the application of manual painting tools and other processes selectively, arbitrarily and without any algorithmic or documentary criteria. We think these practices are incompatible with astrophotography. Eventually, once we have a working layers tool (soon) and drawing tools (we'll have them integrated with layers in a future version), these procedures will also be easy with PixInsight. This won't change the fact that we'll always be against painting the images, though.

The new layers tool (we are still deciding on the final name; maybe it will be LayeredComposition, or just Layers for the sake of simplicity) is actually very nice and useful. In its first version, it implements a complete set of arithmetic pixel operations (Add, Subtract, Multiply, Divide), move operations (Copy, Minimum, Maximum), composition operations (ColorBurn, LinearBurn, Screen, ColorDodge, Overlay, SoftLight, HardLight, VividLight, LinearLight, PinLight, Difference, Exclusion), and bitwise logical operations (OR, AND, XOR, NOR, NAND, XNOR). In addition, it allows you to merge luminance, lightness and chroma components between successive layers. It implements layer masks and allows for real-time mouse and keyboard interaction to select and move layers. I'd like to have it ready for release at the same time as version 1.8, but I'm not sure if we'll be able to achieve that.
Title: Re: How do I combine two master lights
Post by: RBA on 2012 November 10 19:01:22
Good work!

I've always pictured the layers tool in PixInsight as being able to let the user write custom PixelMath operations between layers, in addition to offering a predefined set of operations. That wouldn't only make a significant difference between this and other popular layering tools, but it would also be very useful.

Live preview would also be very desirable, although not having it in the first installment is okay IMHO.


Title: Re: How do I combine two master lights
Post by: Josh Lake on 2012 November 10 19:02:54
I am very much looking forward to working with it, Juan! Godspeed with your development of both 1.8 and this tool.
Title: Re: How do I combine two master lights
Post by: Jim_ on 2012 November 10 19:06:58
Juan,

As the OP of this, and REALLY new at PI, this will really help all of us that grew up on photoshop.
I'm sure this will be a big selling tool for the software!!!

Jim
Title: Re: How do I combine two master lights
Post by: RBA on 2012 November 10 19:10:47
yes, make a luminance mask with the desired strength and have it active when you apply the HDRWT (or any other process for that matter.)
this is the 'right' way to do it in PI. i can see why you are frustrated with having to do it with pixelmath.

I see nothing wrong with applying a process to an image, and then merge it via PixelMath with a copy of that image before applying that last process, no masks involved, at whichever "percentage" we desire.

It all depends what are you trying to do. Luminance/lightness-based masks are great, but they serve different purposes.

Title: Re: How do I combine two master lights
Post by: Warhen on 2012 December 30 17:42:28
This is fantastic Juan. I think it will go a long way towards satisfying Photoshop users, encouraging them to stay in PixInsight for the entire workflow. Looks as if you are enabling masks to be applied to Layers also, as well as blend mode and opacity- fantastic. The last thing on the wish list would be, and I say it with a bucket on my head for fear of attack- a brush! I do understand what has been to date, a philosophical problem with brush tools, but given the existence of the clone tool, and how much more efficient a brush would be, I would love to see it. Thanks!
Title: Re: How do I combine two master lights
Post by: blaurent on 2013 January 03 17:25:30
hello

i create a Script  to  combine  2 or 3 masters

http://pixinsight.com/forum/index.php?topic=4853.0