hello
I need to know the RGB value of a pixel in an image. for example, I want to know the color of the pixel at a specific point (ex 100,100) without using the mousecolor property. my probleme is to put in a container all the colors RGB code existing in an image in a stack.
do you have a solution for that ?
thanks all
François
the color of a pixel
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 4002
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: the color of a pixel
Hi Françcois,
do you just need all the unique RGB values of a given image or do you need the RGB value for each pixel?
Kind regards
Bernd
do you just need all the unique RGB values of a given image or do you need the RGB value for each pixel?
Kind regards
Bernd
Re: the color of a pixel
hello
thanks for your reply
in fact, the both are availables !!!
"need all the unique RGB values of a given image
and need the RGB value for each pixel
"
thanks for your reply
in fact, the both are availables !!!
"need all the unique RGB values of a given image
and need the RGB value for each pixel
"
-
- VIP Livecode Opensource Backer
- Posts: 4002
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: the color of a pixel
Hi François,
here is a little stack that gives you
1) all the unique RGB values of an image (did not implement frequency but is easy to do) are put as list into a field.
2) Then there is a button that ask you for a point in the image (e.g. 53,100) and returns the RGB value for it. You could expand that to a list of all points but that list could get long.
And if you move over the image it displays the column and the row relative to the image and puts the mouseColor into a field (sort of a control for 2)
Some comments in the code, you might want to read up in the dictionary about imageData.
Feel free to ask if something is not clear.
Kind regards
Bernd
here is a little stack that gives you
1) all the unique RGB values of an image (did not implement frequency but is easy to do) are put as list into a field.
2) Then there is a button that ask you for a point in the image (e.g. 53,100) and returns the RGB value for it. You could expand that to a list of all points but that list could get long.
And if you move over the image it displays the column and the row relative to the image and puts the mouseColor into a field (sort of a control for 2)
Some comments in the code, you might want to read up in the dictionary about imageData.
Feel free to ask if something is not clear.
Kind regards
Bernd
- Attachments
-
- rgbValuesOfImage.livecode.zip
- (25.08 KiB) Downloaded 363 times
Re: the color of a pixel
he
tthanks for your stack. it give me a good example of the fonction imagedata I have found yesterday afternoon in the dictionnary. now, J understand how it works
thanks for your help
François
tthanks for your stack. it give me a good example of the fonction imagedata I have found yesterday afternoon in the dictionnary. now, J understand how it works
thanks for your help
François