Would the use of that image be equivalent of programatically chunking the component values.

( floor( c / s ) * s ) where s is the chunk size.

Unfortunately the colors have no known relationship aside that LEGO picked them. :-)

The histogram appears to be working!!! I created a 1*12 image with my 12 colors. Would you be able to explain how the histogram operation works? It seems to have trouble deciding wether my hair is brown or black. I don't know if that is because of the iSight camera or the operation is dependent on overall quantity of a color in an image.

Thank you.
Dave



On Jan 16, 2008, at 10:44 AM, Alex Drinkwater wrote:

As I understand it, each channel has 256 possible values (0 > 255).
So, your lookup table should contain some kind of gradient, from 0 to 255, across each of the R, G, B and A channels. To limit your palette, you'd probably have to pixellete each of the gradients, so that instead of 256 possible values in each channel, you might have, say, 64, or 32, or maybe even fewer. This would limit the palette of available colours.

Something like this would do the job.

<LUT03.png>

The only problem is, it's hard to see what the actual colours you're likely to get are...

The other option of course, is to compile and use the Histogram Operation plugin, that's found in the Developer Examples folder (do a search for it).


Hope this makes sense.

alx




On 16 Jan 2008, at 16:26, David Giovannini wrote:

Hello,

I am having trouble seeing in my head what the lookup table/image/ texture looks like.

The 0..n and n..255 will contain the black and the white. How are the other colors distributed? The components are operating on the same table row. How do I adjust the 256 values to select from the limited pallet?

Thank you,
Dave

On Jan 16, 2008, at 9:15 AM, Alex Drinkwater wrote:

What I failed to mention of course, is that the lookup
table has to be a strip with a width of 256 pixels. It
only needs to be 1 pixel high.

alx



--- Alex Drinkwater <[EMAIL PROTECTED]> wrote:

The code would be a little different in CIKernel
Slang, as texture coordinates are handled
differently.

This code does a similar thing, in CIKernel slang:


kernel vec4 lut(sampler image, sampler LUT)
{
        // Input pixel
        vec4 inPix = unpremultiply(sample(image,
samplerCoord(image)));
        // Output pixel
        vec4 outPix;
        outPix.r = unpremultiply(sample(LUT, vec2(inPix.r *
255.0,0.0))).r;
        outPix.g = unpremultiply(sample(LUT, vec2(inPix.g *
255.0,0.0))).g;
        outPix.b = unpremultiply(sample(LUT, vec2(inPix.b *
255.0,0.0))).b;
        outPix.a = unpremultiply(sample(LUT, vec2(inPix.a *
255.0,0.0))).a;
        
        // Output
        return premultiply(outPix);
}

alx


--- vade <[EMAIL PROTECTED]> wrote:

I would suggest creating a look up table as a
texture, feed that in to
a CIKernel, and have it map the r/g/b vales to the
r/g/b values of the
original image, something in GLSL like:

// define our rectangular texture samplers
uniform sampler2DRect tex0;
uniform sampler1D tex1;

// define our varying texture coordinates
varying vec2 texcoord0;
varying vec2 texcoord1;

void main (void)
{
        vec4 inputColor = texture2DRect(tex0, texcoord0);
                
        vec4 colorout;
        
        colorout.r = texture1D(tex1, inputColor.r).r;
        colorout.g = texture1D(tex1, inputColor.g).g;
        colorout.b = texture1D(tex1, inputColor.b).b;
        colorout.a = inputColor.a;
        
        gl_FragColor = colorout;
}


On Jan 15, 2008, at 10:10 PM, David Giovannini
wrote:

Hello,

Let me describe what I am trying to do a little
better than before.
Every avenue I try comes up short.

My daughter got a LEGO Mosaic set for Christmas.
I
am working on a
pattern maker application using QC. I have the
pixellating and LEGO
impressions all working. The mosaic set comes
with
12 colors where
three are black, dark gray, and white. I need to
have the colors in
the resulting image limited to the 12.

I keep trying to solve this problem using core
image kernels and not
getting the results I am looking for. I keep
looking for "grayish"
and attempting to find either the correct color
or
the correct gray.
There is nothing linear about the LEGO colors
and
"grayish" is very
subjective

Given a set of 12 arbitrary colors, with fixed
HBS, how would I
color match an image?

Any thoughts would be appreciated.

Cheers,
Dave

On Jan 13, 2008, at 12:40 PM, Stephanie
Giovannini
wrote:

Hello,

I am nearly done with a composition but I am
stuck solving a color
matching problem. I want to apply a palette of
12
fixed colors
(intensity, luminosity, saturation, etc all
predetermined) to an
image. The palette includes 3 greys. ColorMap
seems to  be close
but not quite.

What should I be using?

Cheers,
Dave


_______________________________________________
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/dsjove%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/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/the_voder%40yahoo.co.uk

This email sent to [EMAIL PROTECTED]






__________________________________________________________
Sent from Yahoo! Mail - a smarter inbox
http://uk.mail.yahoo.com

_______________________________________________
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]




    __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com

_______________________________________________
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/dsjove%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/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