GetPixel() again

I realise I am probably wasting time asking this again, but here I am a full year on and still no apparent way to read the RGB values of a pixel.

Has anything been added to Corona to allow this during 2012?
The absence of it has killed off my aspirations for developing my app any further.
Im very frustrated not to be able to do ANYTHING about this absent feature.
[import]uid: 108660 topic_id: 32173 reply_id: 332173[/import]

Nope I haven’t seen anything. You could just not use corona, send the image to some php script, then find the rgb value or whatever. There are other ways to do it besides using Lua. [import]uid: 29181 topic_id: 32173 reply_id: 128093[/import]

>There are other ways to do it besides using Lua.

And it work online AND if you will have 1000+ active app users they kill your server if you use typical virtual hosting :slight_smile: [import]uid: 12704 topic_id: 32173 reply_id: 128140[/import]

I am not sure but if you subscribe to the Enterprise version - wouldnt it be possible to add this lua library written i C to Corona?

I am not that technical but I just saw it on the web?

http://ittner.github.com/lua-gd/manual.html

Joakim [import]uid: 81188 topic_id: 32173 reply_id: 128165[/import]

>I am not sure but if you subscribe to the Enterprise version - wouldnt it be possible to add this lua library written i C to Corona?

Yes, it’s possible but will cost you $3000 per year :slight_smile:

>I am not that technical but I just saw it on the web?

Very old and veeeerrrryyy slow solution not usable on mobile… [import]uid: 12704 topic_id: 32173 reply_id: 128167[/import]

>>Yes, it’s possible but will cost you $3000 per year :slight_smile: <<

Well, theres some information I didnt have. Enterprise just sort of slid into the frame but didnt have a price tag when I heard about it 9 months ago.
Way OTT for what should be a simple single function call, already available in the GFX libraries.

(Also, to be honest, I went over and over the docs for Enterprise and still wouldnt have a clue how to even get a library added, even if I had $3000 to spare.)

I gues its my fault for not checking every last function call before I started coding.
Its just been part of every language I have ever used (bar VBDOS )

Its like buying a car and finding that it doesnt have a glove compartment.
You dont even bother asking at the showroom…
[import]uid: 108660 topic_id: 32173 reply_id: 128168[/import]

Not sure what you intend to do with the pixel, but this might help…

You could quickly place the image on the screen, and call display.save() with a 1 pixel size (careful, with virtual scaling, you could get more than 1 pixel).

At that point, you’d have a 1 pixel image of the pixel in question, and could process it as you see fit. If you want to tint it, apply the tint to the captured 1 pixel image, put it back on the display in the proper place, and then re-save the original image bounds (which now contains the original image plus your single tinted pixel).

While not a “fast” way to process an image, a few functions created around this would allow some types of image processing capabilities (albeit slow, compared to code with real access to the buffers). [import]uid: 79933 topic_id: 32173 reply_id: 128170[/import]

>>call display.save() with a 1 pixel size<<

This is SetPixel()
I can do this already with ease: just create a rectangle and use setFillColor

Having done that, or using a picture, I can not ask what RGB value it is now.

I want to ‘understand’ an image. I need to know that this pixel is white, and that pixel is blue.
Some people want this ability to be able to use a bitmap as a massive world map.

Me, I want to traverse a picture.

I can import a picture, and I can put it ‘on the wall’. But that’s it.
I can’t look at it and see that it is a picture of a cross, or a sunset, or a black blob, in code.
All I can do is know that it is there.

Another example : If I could read the pixels, I could open a picture of a Maze and program a rat to run around it.
[import]uid: 108660 topic_id: 32173 reply_id: 128171[/import]

jeff, what was being suggested is that you take the display group that you want to “read”, do a display.save to get it into a file, then read the file’s binary data in LUA and process it any way you want. There are two problems with that. One is that dealing with binary data in LUA in any kind of meaningful name is very awkward. And the other is that the image is saved as a JPEG file, meaning you have to uncompress it before you can read the pixels, and I really don’t see any way it could be done in LUA that would not take a couple of hours to run. [import]uid: 160496 topic_id: 32173 reply_id: 128212[/import]

Nope I haven’t seen anything. You could just not use corona, send the image to some php script, then find the rgb value or whatever. There are other ways to do it besides using Lua. [import]uid: 29181 topic_id: 32173 reply_id: 128093[/import]

>There are other ways to do it besides using Lua.

And it work online AND if you will have 1000+ active app users they kill your server if you use typical virtual hosting :slight_smile: [import]uid: 12704 topic_id: 32173 reply_id: 128140[/import]

I am not sure but if you subscribe to the Enterprise version - wouldnt it be possible to add this lua library written i C to Corona?

I am not that technical but I just saw it on the web?

http://ittner.github.com/lua-gd/manual.html

Joakim [import]uid: 81188 topic_id: 32173 reply_id: 128165[/import]

>I am not sure but if you subscribe to the Enterprise version - wouldnt it be possible to add this lua library written i C to Corona?

Yes, it’s possible but will cost you $3000 per year :slight_smile:

>I am not that technical but I just saw it on the web?

Very old and veeeerrrryyy slow solution not usable on mobile… [import]uid: 12704 topic_id: 32173 reply_id: 128167[/import]

>>Yes, it’s possible but will cost you $3000 per year :slight_smile: <<

Well, theres some information I didnt have. Enterprise just sort of slid into the frame but didnt have a price tag when I heard about it 9 months ago.
Way OTT for what should be a simple single function call, already available in the GFX libraries.

(Also, to be honest, I went over and over the docs for Enterprise and still wouldnt have a clue how to even get a library added, even if I had $3000 to spare.)

I gues its my fault for not checking every last function call before I started coding.
Its just been part of every language I have ever used (bar VBDOS )

Its like buying a car and finding that it doesnt have a glove compartment.
You dont even bother asking at the showroom…
[import]uid: 108660 topic_id: 32173 reply_id: 128168[/import]

Not sure what you intend to do with the pixel, but this might help…

You could quickly place the image on the screen, and call display.save() with a 1 pixel size (careful, with virtual scaling, you could get more than 1 pixel).

At that point, you’d have a 1 pixel image of the pixel in question, and could process it as you see fit. If you want to tint it, apply the tint to the captured 1 pixel image, put it back on the display in the proper place, and then re-save the original image bounds (which now contains the original image plus your single tinted pixel).

While not a “fast” way to process an image, a few functions created around this would allow some types of image processing capabilities (albeit slow, compared to code with real access to the buffers). [import]uid: 79933 topic_id: 32173 reply_id: 128170[/import]

>>call display.save() with a 1 pixel size<<

This is SetPixel()
I can do this already with ease: just create a rectangle and use setFillColor

Having done that, or using a picture, I can not ask what RGB value it is now.

I want to ‘understand’ an image. I need to know that this pixel is white, and that pixel is blue.
Some people want this ability to be able to use a bitmap as a massive world map.

Me, I want to traverse a picture.

I can import a picture, and I can put it ‘on the wall’. But that’s it.
I can’t look at it and see that it is a picture of a cross, or a sunset, or a black blob, in code.
All I can do is know that it is there.

Another example : If I could read the pixels, I could open a picture of a Maze and program a rat to run around it.
[import]uid: 108660 topic_id: 32173 reply_id: 128171[/import]

jeff, what was being suggested is that you take the display group that you want to “read”, do a display.save to get it into a file, then read the file’s binary data in LUA and process it any way you want. There are two problems with that. One is that dealing with binary data in LUA in any kind of meaningful name is very awkward. And the other is that the image is saved as a JPEG file, meaning you have to uncompress it before you can read the pixels, and I really don’t see any way it could be done in LUA that would not take a couple of hours to run. [import]uid: 160496 topic_id: 32173 reply_id: 128212[/import]

In light of the fact that this feature isn’t coming anytime soon to CoronaSDK. Does anyone know of any other mobile app engines they can suggest that will enable a ‘getPixel’ or pixel analysis equivalent functionality?

Yes, I have Googled prior to posting this and would really appreciate any input.

Cheers in advance, [import]uid: 21125 topic_id: 32173 reply_id: 143154[/import]

In light of the fact that this feature isn’t coming anytime soon to CoronaSDK. Does anyone know of any other mobile app engines they can suggest that will enable a ‘getPixel’ or pixel analysis equivalent functionality?

Yes, I have Googled prior to posting this and would really appreciate any input.

Cheers in advance, [import]uid: 21125 topic_id: 32173 reply_id: 143154[/import]

In light of the fact that this feature isn’t coming anytime soon to CoronaSDK. Does anyone know of any other mobile app engines they can suggest that will enable a ‘getPixel’ or pixel analysis equivalent functionality?

Yes, I have Googled prior to posting this and would really appreciate any input.

Cheers in advance, [import]uid: 21125 topic_id: 32173 reply_id: 143154[/import]