Question about image scaling

Hello, newbie here.

I understand it is possible to scale images? As in, I could have a 500x500 px image in my program, but scale it down to 100x100 at one point in my app, and down to 200x200 in another place.

I understand this would probably create for an app that runs slower than it would if one would just create two different sizes of the image, but how much load is it?

I think I might need 3 or 4 different sizes of images in the app I am dreaming up at different times, so scaling on the fly might actually be convenient for me.

Let me know your thoughts!
[import]uid: 191855 topic_id: 34607 reply_id: 334607[/import]

Corona does this automatically. It’s called “dynamic content scaling” and you simply provide multiple sizes of each of your image assets, with suffixes to their filenames, and Corona will select the correct image for te device your app is running on.

There were a bunch of posts a while ago:

http://www.coronalabs.com/blog/2011/01/27/dynamic-image-resolution-made-easy/
http://www.coronalabs.com/blog/2010/11/20/content-scaling-made-easy/

These more recent posts might also be useful:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/
http://www.coronalabs.com/blog/2012/10/09/dynamically-optimized-sprite-sheets/
http://developer.coronalabs.com/forum/2011/01/27/things-you-have-provide-your-ios-apps-icons-and-launch-images [import]uid: 8271 topic_id: 34607 reply_id: 137604[/import]

Sorry for the confusion, I think my explanation may have been unclear.

I am actually wondering if I can provide a *single* size of my image assets, and then scale them to the size that I need on the fly in my program. [import]uid: 191855 topic_id: 34607 reply_id: 137611[/import]

Yes, use the .xScale and .yScale properties. Read through the API documentation:

http://docs.coronalabs.com/api/ [import]uid: 8271 topic_id: 34607 reply_id: 137622[/import]

Yes you can, but you pay a price for it in performance or quality.

If you provide graphics that are scaled for the 640x960 iphones or 1024x768 iPads, they will have to be downsized for iPhone 3Gs’s. This requires extra CPU work and the memory usage is for the larger image and memory is limited on the older devices. Going the other way, for the Retina iPads or the new 10" Nooks and Kindle Fires, Corona is going to have to stretch your images to make them large enough and you will find them softer and fuzzier than if you provided native @4x images.

It’s a trade off. You’re app bundle will be smaller providing only one size of files but it’s not going to be as good on the extreme devices. If you provide multiple resolution images, you can better manage your system resources but the app bundle grows in size rapidly.

[import]uid: 199310 topic_id: 34607 reply_id: 137626[/import]

Corona does this automatically. It’s called “dynamic content scaling” and you simply provide multiple sizes of each of your image assets, with suffixes to their filenames, and Corona will select the correct image for te device your app is running on.

There were a bunch of posts a while ago:

http://www.coronalabs.com/blog/2011/01/27/dynamic-image-resolution-made-easy/
http://www.coronalabs.com/blog/2010/11/20/content-scaling-made-easy/

These more recent posts might also be useful:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/
http://www.coronalabs.com/blog/2012/10/09/dynamically-optimized-sprite-sheets/
http://developer.coronalabs.com/forum/2011/01/27/things-you-have-provide-your-ios-apps-icons-and-launch-images [import]uid: 8271 topic_id: 34607 reply_id: 137604[/import]

Sorry for the confusion, I think my explanation may have been unclear.

I am actually wondering if I can provide a *single* size of my image assets, and then scale them to the size that I need on the fly in my program. [import]uid: 191855 topic_id: 34607 reply_id: 137611[/import]

Yes, use the .xScale and .yScale properties. Read through the API documentation:

http://docs.coronalabs.com/api/ [import]uid: 8271 topic_id: 34607 reply_id: 137622[/import]

Yes you can, but you pay a price for it in performance or quality.

If you provide graphics that are scaled for the 640x960 iphones or 1024x768 iPads, they will have to be downsized for iPhone 3Gs’s. This requires extra CPU work and the memory usage is for the larger image and memory is limited on the older devices. Going the other way, for the Retina iPads or the new 10" Nooks and Kindle Fires, Corona is going to have to stretch your images to make them large enough and you will find them softer and fuzzier than if you provided native @4x images.

It’s a trade off. You’re app bundle will be smaller providing only one size of files but it’s not going to be as good on the extreme devices. If you provide multiple resolution images, you can better manage your system resources but the app bundle grows in size rapidly.

[import]uid: 199310 topic_id: 34607 reply_id: 137626[/import]