pick a color from picture, to recover this color coordinates in an other picture

Fratzen's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hi,
stupid problem I guess:
I have two pictures for instance.
Thx to suckah, I have rgb coordinates of my mouse cursor.
I would like to find this particular picked color in an other picture.
I trie with jit.findbounds, but the color displayed in the second picture is not as expected. (see the patch).
"jit.op @op==" should be a solution too, (xray.cellocoordinates should give me the coords, but doesn't work…).
don't really know what I do wrong…
any help would appreciated.
thx.
f

frjurado's icon

i just had a quick look at your patch, but it seems to me you're asuming suckah gives you ARGB. in fact it outputs RGBA, so you're ignoring red and using alpha, so that it finds unexpected colors...

Fratzen's icon

thx for response. stupid mistake; change this gives me nobounds at all, worse

Max Patch
Copy patch and select New From Clipboard in Max.

I'm not really kind of jit.findbounds anyway…sure there is a better way……
well ok if it could just work;)

f.

frjurado's icon

ok, no i have no idea wth is going on :(

Fratzen's icon

would some of you know about this ? Would it be a bug ?
f

frjurado's icon
Max Patch
Copy patch and select New From Clipboard in Max.

i think you just gave it too small a color range. i tried with the green number box and it goes better:

Fratzen's icon

I still don't really get the result, why such a great difference according to the picked color…?
When I am in the "red area", the bound is x boundbox is 320, almost the entire matrix, I need more precision…

Shouldn't be possible to just retrieve one pixel of the second image ?

What I really need: If I pick white color from the first picture by example, I need to get cellcoords in the second picture of cells wich respond to "yes I'am white and here's my xy coordinates".

I'm pretty lost about this ! thx anyway oldturtle.

f.

Lance Green's icon

Need specific description,thanks.

Fratzen's icon

no time for bycycle right now, if anyone has more wise advice, I'll take it ;)

Fratzen's icon

would someone know about this ?
little emergency here !
thx
f

FRid's icon

Noticed your post yesterday and i had a go but i'm also having a hard time trying to solve this. Somehow the colors get compared individually i think. Sure somebody else will chime in.

Max Patch
Copy patch and select New From Clipboard in Max.

HTH (a bit)
FRid

Fratzen's icon

Thx a lot!!
I was little rushed.
really nice little patch comparing to my mess !!
big up
f

Fratzen's icon

sorry for the noise, but I still have lot of weird values…though I have to be very precise…
unicolor works just fine, the problem is when the color is composed of several primary colors…
I'm really lost…fiou…
I attached the patch and my thermal picture with its scale, wich I have to analyse to know almost every pixel temperature !

Max Patch
Copy patch and select New From Clipboard in Max.

thx.

3613.thermo.jpeg
jpeg
Rob Ramirez's icon

what do you want to do with the results?
i would just use jit.chromakey, which will allow you to adjust things like threshold and feathering.

you can tell it to output the keyed channel (@mode 1 or 2).

if you need it to be binary, send it to a jit.op @op > for thresholding.

Fratzen's icon

thx rob.
I have to analyse the argb pixel from a thermal picture, and find the position of the corresponding color in the scale picture to deduce the temperature of the analyse pixel…

I'm gonna try jit.chromakey, but I'm affraid of the needed ressources (about 10 points, so 10 jit.chromakey).
thx
f

Fratzen's icon

Hi,
I've made my little really simple shader for this problem. hm "==" does the trick…
I would like to know how could I streched the color bar. I trie to put an offset on result.y but I think I must confused .r and .x coordinates in shaders wich I'm not familiar to.
Could you just take a glance to this little patch and shader ? I use the same "scale.png" file than precedently post.
here's the patch and the shader:

    find any common colors in 2 matrixes.
    

Max Patch
Copy patch and select New From Clipboard in Max.

3640.scale.png
png