Image Manipulation?

Hey guys,

So I was reading through the great walkthrough on how you created the 20th Anniversary Photoshop app ( http://developer.anscamobile.com/documentation/making-of-photoshop-20th-anniversary ) and saw at the bottom that apparently some of the image alterations were made using pixel-level bitmap manipulation features that haven't been made publicly available yet and that they are to be included with Corona 1.2.

Looking at the roadmap I don't see anything about this, except maybe in the Game Edition roadmap where it mentions bitmap manipulation in Q3.

Is this still a planned API? This type of stuff would be absolutely amazing to provide access for I think.

We're considering it. The biggest problem is it has a huge impact on performance. Most everything in Corona is OpenGL accelerated, and if we open up to modifying images per frame, that will, well, kill performance.

What kinds of bitmap manipulation do you want?

Eric,

The bitmap manipulation that I also requested time ago was the ability to:

- change pixel color
- free transformation, like resize or move each corner of the bitmap in a freedom way. That could allow to fake some perspectives views for a 2.5D game.
- image blending, like alpha or multiply blending.
- mask blending
- desaturate, i.e. turn its colors into grayscale
- contrast/bright alteration

Regards,

Flavio
fpassa@gmail.com

Not to mention it would be nice to just have the ability to modify some images on the fly, not necessarily something that one would do in an fps situation. Perhaps an example would be dynamically build a map made up of tiles. Rather than moving a large number of tiles around the screen, it would just be moving the entire background texture (1 object).

For this I'd need to be able to "drawIntoTexture(srcTexture, destTexture, destX, destY, [{srcX, srcY, srcW, srcH}])". This would draw the src into the dest at the dest coords of destX, destY. Optionally, one could specifcy the srcX, srcY, srcWidth, srcHeight to only draw a subset of the src texture.

Going with the "dynamic map creation" theme, this would allow me to have one source texture that contained all my tiles and one destination texture which represents my max dungeon size.

Thanks,
Scott

I'm really hoping this would be updated.

Changing pixel information and mask/blending would be incredibly useful.

Once OpenGL ES 2.0 shaders are done in Q3 this will not be as big of an issue. If we can write our own shaders we can write almost any image manipulation. Plus it is incredibly fast. I already have a very nice library of fragment and post processing filters for general image manipulation (blurring, sharpening, blending, etc) and they are very fast.

Image manipulation (pixel level) would be very useful, any update?

I need this too. Would like to build a super simple drawing app for kids, so I need to be able to implement flood fill...

Would this be available soon?

I would like to modify camera and other images. I would like to convert images into table-based arrays, do some maths etc, and convert back to png or jpegs. I don't need real-time processing, so the Anniversary Photoshop app methods should be OK for me.

Thanks!

Thumb up for :
- change pixel color
- free transformation, like resize or move each corner of the bitmap in a freedom way. That could allow to fake some perspectives views for a 2.5D game.
- image blending, like alpha or multiply blending.
- mask blending
- desaturate, i.e. turn its colors into grayscale
- contrast/bright alteration

I also would like to use kind of height map effect and other great stuff like this :)

Well, image manipulation could allow a infinite of new gameplay and graphism.

I would also be able to use this, if only to be able to get the color of a pixel and change it. All of the other options that people have suggested seem reasonably useful too.

How about just detecting the color of a single pixel in an image?

The rest would be nice to have but detecting the color of a pixel would be a great start.

+1, see my request "2d graphics and UI foundation".

+1 to see this implemented using frame buffer objects.

A way to iterate through pixels for their color code would be useful.

drawIntoTexture(srcTexture, destTexture, destX, destY, [{srcX, srcY, srcW, srcH

+1

I hope it won't be a function call for every pixel. That would be slow as crap.

I would imagine that any kind of manipulation would need to be returned as an array to operate on. opengl makes it pretty easy to get a buffer of the pixels, not sure how easy it is to shove that back into the texture though. I would assume you would prolly end up with something like:
pixelArray = myImage.getPixels()
-- manipulate on r,g,b,a * w *h
myImage.setPixels(pixelArray);
Granted this would be operating directly on the floating point values of a very large array. I have no clue how well lua handles really large loops like that on a mobile device.

I just read this thread a little more carefully, especially Eric's comment.

I almost think this thread could fall into 2 buckets.
1. Flash BitmapData style manipulation to gain performance.
2. Generative drawing.

BitmapData style could be something that could be handled with framebuffer objects. This has a lot of potential of actually INCREASING performance on things like tilemaps, parallax scrolling, and drawing applications. Basically they could be setup just like images, but you are able to draw other textures to the texture and only clear it when you want. Example of something that could really benefit from it would be lime. Another example would be a drawing application where you had a canvas that you wanted to "stamp" sprites onto without it being cleared.

Generative drawing would make more sense as something that could happen up front, like when you prepare your scene. I do think it would be nice to at least have some options to do this, with disclaimers about performance. Would give people a lot of room to create dynamic bitmap art.

Anyhow hope these suggestions help.

+1 to the ability to replace a color within a display object, whether filled by corona by rect colorfill, or filled with an image.

Right now the only way I'm able to accomplish this is to use "bitmask" which is not exactly the easiest and cleanest way to develop that.

Or, perhaps give me an example code of Color Fill that will only fill non-transparent parts (ignore transparent parts). As of now, importing a PNG and filling the object, it fills the entire object.

I think the non-transparent fill would be awesome.

:)

Thanks!

In fact the ability to manipulate images is a key factor in the app I'm planning to develop. I don't need real-time manipulation as I'm processing a picture (as in your Photoshop app).

If it's slow, then leave it at the developer's discretion to either use it or not. Or to find creative ways for using it.

I'm exploring Corona, but I think I'll have to move to a different platform unless we get an update soon on this matter.

Ramis,

The first app idea that I got involves your basic image manipulation.

I just need to fill in a display object with a color, without it filling over the transparent parts. Or I need to replace a color. It's part of a designing app I'm making the involves changing colors of on screen images.

So far the only way to do this is to use the bitmask thing, and that's a hack at best.

I will probably just not be able to work on this app (which I really wanted to make, and it was going to be a really great one too), and just focus on what the boundaries are of their api.

Would be nice if yall could put some of this stuff in, particularly a color replacement one-liner.

.replaceColor({255,255,255}, {255,255,0});

That seems cool right?

Well, this thread seems to be one of the most active in the Feature Requests forum, both in reads and replies.

I guess that means something!

bump

+1
at lease minimum pixels (colors changing, saving results to file...) will be great to have

+1
at lease minimum pixels (colors changing, saving results to file...) will be great to have

+1
at lease minimum pixels (colors changing, saving results to file...) will be great to have

+1 as well.

I've been researching some game frameworks lately and Corona is incredibly crippled due to lack of such basic functionality like:

* bitmap manipulation
* no multitasking support whatsoever
* inability to add any external native code

With some EDK support like it is done in AirPlay 4.4 or at least native code-generation moved to local computer (like in Titanium), we could implement everything else what is missing (push notifications, game center, airprint, airplay, well, almost every iOS feature).

With ease of Lua and great marketing, Corona has a chance to become one of the best game frameworks out there. Right now, developers I know are mostly torn between Titanium for apps (because Corona lacks native UI controls), AirPlay for games (because Corona lacks EDK, bitmap manipulation etc) and Corona for ONLY simple, low budget games.

How about instead of just reworking price models, you just give some power to the people to extend your framework?

I agree with Vith on the EDK, but let's not pollute this thread with that discussion. I've started a new thread on that topic here: http://developer.anscamobile.com/forum/2011/02/23/native-code-extensions-breaking-out-corona-sandbox

@vith : need my crutches. my wheelchair and need my "handicap" sticker for my car....

Surely I jest.

http://www.youtube.com/watch?v=UwZF_NO8se0
and
http://www.youtube.com/watch?v=9oiH9lp68YU
and with your own chrome
http://www.youtube.com/watch?v=Mmm3wYh5lYA

Everyone else beats us when it comes to UI. We just make simple thing simpler. Hard to believe.

;-)

C.

@carlos

I've seen it, looks great and is of course one of most needed features as well. Is it in daily builds? Or when is it planned to be released?

But some image transformation is needed as well.
Possibly blending layers solution (colorize, saturate, maybe some other types) would work great here.

When this comes + multi tasking + push notifications + possibly open EDK I would stay a life-long subscriber ;)

@Carlos,

I too need to perform basic image processing, to inspect images at a pixel level, this type of functionality would be greatly appreciated and used if available. Please consider releasing the photoshop API or some facsimile.

Thanks

As a first step, a getPixel and setPixel similar to the BitmapData class in Flash would be ok for me

@Carlos,

Thanks for peeking in on this thread.

I believe some more flexible (bug free) display object/file manipulation features related to display.save (http://developer.anscamobile.com/reference/index/displaysave) would be a great start.

I believe the issues I am having are more likely related to bug/[case #928]: problem capturing the entire object on iPad and iPhone4 devices when Dynamic Scaling (in config.lua) is enabled.

Best wishes,

Paul Allan Harrington
http://www.pahgroup.com

I think bug/[case #928] has been fixed.

c.

Carlos, again thanks for staying in touch with all of these threads. And also thanks for all the efforts you are making to improve the Corona SDK. I also appreciate the commitment to increasing the availability of helpful information via new additions to the Corona team such as Jonathon Beebe.

With that said, Case #928, if it has been resolved, the information should be reflected in the current API Reference (http://developer.anscamobile.com/node/2469) with additional information such as which build accomplished the fix.

I know you are working hard to improve the product and I hope we can find more efficient ways to keep the documentation current and easily accessible.

I would love to see a blog posting of your thoughts as to how you envision the Corona community could best maintain a more current and accurate Corona "Wiki".

Again, thanks for keeping in close contact with the Corona user base.

Side Note: I'll work through the issue I thought was related to case #928 and post my results as soon as I can accomplish it.

Sincerely,

Paul Allan Harrington
http://www.pahgroup.com

I too am in great need of access to pixel data. Sometimes being able to read pixel data can be invaluable to make interesting apps. I discovered Corona this week and was working on two apps using pixel data in JavaScript before. I love Corona so far, but I am currently struggling to find a way to use pixel data to port my apps (which are really fast with the pixel data calculations, but just too slow with animations). The only workaround so far is storing info in files and read that. However, it takes up loads of memory and is incredibly slow.

I would love you so, SO much if you'd release if even the simplest of image data/manipulation APIs. The sooner the better. :)

Thanks for creating such a great product!
~Wouter

We too, would really benefit from image manipulation. Particularly image cropping and resizing for an app we're looking to do.

Have there been any advancements in this area? I see "Improvements to image saving API" in the high priority section on the road map and was hoping it had been worked on recently. Thanks for any info you can offer us.

+1, bump etc. One of my app ideas would need this.

+1, had a project idea that I scrapped because of this missing feature.

All i'd need is to be able to find a pixel's luminosity. something like 'getPixel' would be perfect!

+1 on being able to do pixel drawing/shading

views:2853 update:2011/9/18 10:09:28
corona forums © 2003-2011