Topics

Seeking Clarification of Procedure for Averaging Images


Rick Gordon
 

Dan,

So far, I haven't found a clear breakdown of how you layer your images to create a par result — in such a way that the result is not affected by the order of layering or which image is at the bottom of the stack. I've searched around, but am not finding a clear explanation of the procedure.

Also, a second question: How are you building the flat versions of your images?

It seems as though this should be simple, but my experiments are not giving me exactly the results that I'd expect.

Thanks.

___________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________
WWW: http://www.shelterpub.com


John Gillespie
 

You can make an average version by loading the images into a stack (File->Scripts->Load Files Into Stack). Select browse then click the images you want.
Once loaded (which may take a while if you choose a lot of images) select all the layers and then select Layers->Smart Objects->Convert To Smart Object (there is an option to do this on the file selection dialog but it doesn't always seem to work). Then select Layers->Smart Objects->Stack Mode->Mean.
You can also have fun with the other stack modes.

The alternative is to load all the images individually then adjust the opacity for each item, which needs to be done in proportion 1/N where N is the position from the bottom of the stack. So for 3 images it is 100% then 50% then 33%. With more than 5 images this is tedious and increasingly inaccurate as the percentage must be a whole number. So the first version is better if you are happy with a strictly equal contribution from each image. The second method is easier if you want to experiment with different weights.


John Gillespie
 

Interestingly to make sure I set out the steps correctly I ran through it quickly with with a random selection of entries from the Monument Valley exercise and the result was a really nice image with good colour and contrast. 


Dan Margulis
 



On Jul 8, 2020, at 6:24 AM, John Gillespie <john@...> wrote:

The alternative is to load all the images individually then adjust the opacity for each item, which needs to be done in proportion 1/N where N is the position from the bottom of the stack. So for 3 images it is 100% then 50% then 33%. With more than 5 images this is tedious and increasingly inaccurate as the percentage must be a whole number. So the first version is better if you are happy with a strictly equal contribution from each image. The second method is easier if you want to experiment with different weights.
_._,_._,_
This is how I make the par versions, a stack of five layers with the top four at opacities of 20, 25, 33, and 50. I use this approach for flexibility. I make the tentative par version a day ahead of time based on what I think then are the five best versions, and then if better ones come in at the deadline it’s easy to substitute the appropriate layer(s).

Dan


Rick Gordon
 

Based on the maxim that "the median is affected by outliers and skewed data than the mean, and is usually the preferred measure of central tendency when the distribution is not symmetrical" <https://www.abs.gov.au/websitedbs/a3121120.nsf/home/statistical+language+-+measures+of+central+tendency#:~:text=In%20a%20distribution%20with%20an,value%20is%20the%20middle%20value.&text=Advantage%20of%20the%20median%3A,the%20distribution%20is%20not%20symmetrical.>, that brings up an interesting note: as to whether doing this with Median as opposed to Mean would mitigate the damage of "one bad apple spoiling the apple cart."

Rick Gordon

--------------------
On July 8, 2020 at 2:54:31 PM [-0700], John Gillespie wrote in an email entitled "Re: [colortheory] Seeking Clarification of Procedure for Averaging Images":
Once loaded (which may take a while if you choose a lot of images) select all the layers and then select Layers->Smart Objects->Convert To Smart Object (there is an option to do this on the file selection dialog but it doesn't always seem to work). Then select Layers->Smart Objects->Stack Mode->Mean.
You can also have fun with the other stack modes.
___________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________
WWW: http://www.shelterpub.com


Gerald Bakker
 

On Thu, Jul 9, 2020 at 12:01 AM, Rick Gordon wrote:
Based on the maxim that "the median is affected by outliers and skewed data than the mean, and is usually the preferred measure of central tendency when the distribution is not symmetrical" <https://www.abs.gov.au/websitedbs/a3121120.nsf/home/statistical+language+-+measures+of+central+tendency#:~:text=In%20a%20distribution%20with%20an,value%20is%20the%20middle%20value.&text=Advantage%20of%20the%20median%3A,the%20distribution%20is%20not%20symmetrical.>, that brings up an interesting note: as to whether doing this with Median as opposed to Mean would mitigate the damage of "one bad apple spoiling the apple cart."
That's an interesting thought for sure. I couldn't resist trying this out on one of the exercise images, the Panama photo, the only for which I had downloaded 5 versions. Well, the result surprised me, as the two procedures give quite different results. Different color ("mean" version somewhat more saturated) and different weight ("median" version a bit lighter).

I don't want to draw many conclusions from just one example, but I noticed something that may be typical. Zooming in to 100%, the "mean" version looks smoother, whereas the "median" shows a bit more color noise and is slightly more splotchy. I think the reason is that averaging pixel values has a smoothing effect. Taking the median however implies that one pixel may come from version A and a nearby pixel from version B, causing a more rough appearance. The more differences between the base versions, the stronger this effect.
--
Gerald Bakker
http://geraldbakker.nl


Dan Margulis
 



On Jul 9, 2020, at 6:23 AM, Gerald Bakker <gc.bakker@...> wrote:

I don't want to draw many conclusions from just one example, but I noticed something that may be typical. Zooming in to 100%, the "mean" version looks smoother, whereas the "median" shows a bit more color noise and is slightly more splotchy. I think the reason is that averaging pixel values has a smoothing effect. Taking the median however implies that one pixel may come from version A and a nearby pixel from version B, causing a more rough appearance. The more differences between the base versions, the stronger this effect. 

Correct. Median is generally more useful when comparing gross objects, not individual pixels. If, for example, we wanted to know our consensus view on how colorful to make Monument Valley, well I suppose it would be possible to write a routine that evaluates how colorful each individual version is. In determining our consensus we would want to pick the median, because the mean would be too colorful (there are  more extremely colorful versions than extremely dull ones).

On a pixel level the noise occurs in transition areas. For example, everyone had different ideas about how to transition into the shadows of the greenery, some people basically just plugged them and others had a lengthy transition zone. In that transition zone, every change in pixel value from its neighbor affects the mean. It may affect the median but it may not. So the transition in the mean is smooth and in the median not.

Dan



Thomas Hurd,MD
 

John, 

Thanks for showing that maneuver. I hadn’t tried it before, but it worked very well!

Obviously, the having fun with the the stack modes was just a little too much fun when I tried them. Maximum and minimum are good tricks to have. Imexpected a bit more from standard deviation.

Tom Hurd




On Jul 8, 2020, at 6:24 AM, John Gillespie <john@...> wrote:

You can make an average version by loading the images into a stack (File->Scripts->Load Files Into Stack). Select browse then click the images you want.
Once loaded (which may take a while if you choose a lot of images) select all the layers and then select Layers->Smart Objects->Convert To Smart Object (there is an option to do this on the file selection dialog but it doesn't always seem to work). Then select Layers->Smart Objects->Stack Mode->Mean.
You can also have fun with the other stack modes.

The alternative is to load all the images individually then adjust the opacity for each item, which needs to be done in proportion 1/N where N is the position from the bottom of the stack. So for 3 images it is 100% then 50% then 33%. With more than 5 images this is tedious and increasingly inaccurate as the percentage must be a whole number. So the first version is better if you are happy with a strictly equal contribution from each image. The second method is easier if you want to experiment with different weights.


Rick Gordon
 

I haven't experimented yet, but I have a hunch that masks made from the L, and maybe even the a* and b* of a standard deviation stack rendering, maybe auto toned or maybe not, might offer some intriguing possibilities, maybe somewhat analogous to what can be done with auto toned difference masks.

Even the a* and b* channels of a standard deviation stack rendering show the contours of objects in ways that I bet, used as masks, could lead to some interesting results.

I've got to check that out.

Rick Gordon

--------------------
On July 9, 2020 at 4:17:35 PM [-0700], Thomas Hurd,md Via Groups.io wrote in an email entitled "Re: [colortheory] Seeking Clarification of Procedure for Averaging Images":
I expected a bit more from standard deviation.
___________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________
WWW: http://www.shelterpub.com


Thomas Hurd,MD
 

Rick,

Your  hunch is correct.

  • Just took a 5 layer stack in VARIANCE mode. 
  • Converted to LAB.
  • Took the L channel from the variance mode stack and placed it’s mask on 510 over 511 blended in luminosity.
  • The yellow from 511 came through with the mask much more than luminosity with no mask.
So, in this particular instance, looks like the bright values in the Variance stack L channel are the luminance of the yellow flowers.


Tom






On Jul 9, 2020, at 7:29 PM, Rick Gordon <lists@...> wrote:

I haven't experimented yet, but I have a hunch that masks made from the L, and maybe even the a* and b* of a standard deviation stack rendering, maybe auto toned or maybe not, might offer some intriguing possibilities, maybe somewhat analogous to what can be done with auto toned difference masks.

Even the a* and b* channels of a standard deviation stack rendering show the contours of objects in ways that I bet, used as masks, could lead to some interesting results.

I've got to check that out.

Rick Gordon

--------------------
On July 9, 2020 at 4:17:35 PM [-0700], Thomas Hurd,md Via Groups.io wrote in an email entitled "Re: [colortheory] Seeking Clarification of Procedure for Averaging Images":
I expected a bit more from standard deviation.
___________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________
WWW: http://www.shelterpub.com