Intriguingly, if you convert both of your examples to greyscale in Photoshop (I used CS3) by desaturating, the averaging example gives a more accurate gradation of grey values.

Not sure what that means....

Sorry for the bad screenshot, incidentally.


a|x



<<inline: LuminosityExamples.png>>







On 4 Aug 2008, at 21:40, Alessandro Sabatelli wrote:

Using a simple average (r+g+b)/3 we get:
<avg.png>


And using r*0.2126 + g+0.7152 + b*0.0722 we get:
<lum.png>


I "think" I prefer the latter...
.xX

On Aug 4, 2008, at 1:33 PM, Alessandro Sabatelli wrote:

I simply averaged the rgb in the provided example, but Anton's solution for computing the luminosity is much better (at least for humans).
.xX

On Aug 4, 2008, at 1:20 PM, vade wrote:

he mean externally form the javascript patch. Computer the luma by converting to black and white, or use rec709 luma values in a CIKernel, and get the area average, and pass that into the JS.

I think external reffered to outside the JS patch, not outside QC :)

CI kernel for rec 709 luma coefficients (as per HDTV spec):

/* luma coeffs Y' = 0.2126 R' + 0.7152 G' + 0.0722 B */

const vec3 lumacoeff = vec3(0.2126,0.7152,0.0722);

kernel vec4 lumaKernel(sampler image)
{
        vec4 inputImage = sample(image, samplerCoord(image));
        float luma = dot(inputImage.rgb, lumacoeff);

        return vec4(luma,luma,luma,inputImage.a);
}


On Aug 4, 2008, at 4:14 PM, Alex Drinkwater wrote:

On 4 Aug 2008, at 21:10, Alessandro Sabatelli wrote:

Create an object:

var myObject = new Object()

Then add the image and the brightness, which you can compute externally:

That's the point though:
he wants to compute the brightness IN Quartz Composer.


a|x
http://machinesdontcare.wordpress.com




myObject.image = image
myObject.brightness = brightness

Then store the image in an array

myArray[index] = myObject

Once you've downloaded and processed all of the images then sort

myArray.sort(f)

Where f simply compares the brightness

function f(a, b) {
        return a.brightness-b.brightness
}

Here's an example which shows it working:

<Brightness Sort.qtz>

.xX

On Aug 3, 2008, at 1:58 PM, aienn wrote:


On Aug 4, 2008, at 12:12 AM, Alessandro Sabatelli wrote:

You can store the average brightness along with the image and then return the sorted list of images from JS.

Yep, I already figured out the JS and averaging stuff, but how exactly do I store the average brightness along with the image, as you're suggesting?

a.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/the_voder%40yahoo.co.uk

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/doktorp%40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/asabatelli%40apple.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/asabatelli%40apple.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/the_voder%40yahoo.co.uk

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to