Image compression

I have tested my app in different devices, but in some devices the size of the assets  is changed like in nexus but its working fine in doodle,iphone. 

What could be the reason for the changing of the size of the assets.?

When you say “size of the assets”, you mean the file-size/number of KB or MB per file?  What kind of file are you talking about?  (jpeg, png, etc.)

And does the image look ok on Nexus, despite the changed size?

I mean, the width or height of png file  got changed on some device. 

Some times images got stretched little bit and sometimes its width and height  reduced.

IMAGE ON IPHONE IS LIKE THIS WHICH IS PERFECTLY FINE:

IMAGE ON NEXUS WHICH IS NOT AS PER THE WIDTH AND HEIGHT DEFINED.

Can you post the code that is generating those image?  display.newImage or newImageRect?  what other parameters are you sending it?

local gunBlack = display.newImageRect(“images/indicator.png”,416,414)

gunBlack.x = 20 

gunBlack.y = 700

gunBlack.rotation = 2          

gunPower = display.newImageRect(“images/black_rotate.png”,411,419)

gunPower.x = 20

gunPower.y = 700

gunPower.rotation = 41  

gunBase = display.newImageRect(“images/launcher.png”,469,468)

gunBase.x = 20

gunBase.y = 700

local mask=graphics.newMask(“images/turrat.png”)

gunTurret = display.newImageRect(“images/turret_2.png”,476,477) – 120,120 217 525

gunTurret.anchorX=0.22   

gunTurret.anchorY=0.714    

gunTurret.x = 22–92  

gunTurret.y = 698–645  

gunTurret.rotation =0

gunTurret:setMask(mask)  

I suppose you’re using zoomStretch scaling? That will deform images to fit the resolution of the device.

See http://docs.coronalabs.com/guide/basics/configSettings/index.html

I am using scale=“stretch”

“stretch” is not a valid value for the scale, so it will default to zoomStretch. Using stretching will do just that - stretch the picture to fit the device, potentially deforming it if the aspect ratio of the device is different from whatever you are using in your config. That is the effect you are seeing.

When you say “size of the assets”, you mean the file-size/number of KB or MB per file?  What kind of file are you talking about?  (jpeg, png, etc.)

And does the image look ok on Nexus, despite the changed size?

I mean, the width or height of png file  got changed on some device. 

Some times images got stretched little bit and sometimes its width and height  reduced.

IMAGE ON IPHONE IS LIKE THIS WHICH IS PERFECTLY FINE:

IMAGE ON NEXUS WHICH IS NOT AS PER THE WIDTH AND HEIGHT DEFINED.

Can you post the code that is generating those image?  display.newImage or newImageRect?  what other parameters are you sending it?

local gunBlack = display.newImageRect(“images/indicator.png”,416,414)

gunBlack.x = 20 

gunBlack.y = 700

gunBlack.rotation = 2          

gunPower = display.newImageRect(“images/black_rotate.png”,411,419)

gunPower.x = 20

gunPower.y = 700

gunPower.rotation = 41  

gunBase = display.newImageRect(“images/launcher.png”,469,468)

gunBase.x = 20

gunBase.y = 700

local mask=graphics.newMask(“images/turrat.png”)

gunTurret = display.newImageRect(“images/turret_2.png”,476,477) – 120,120 217 525

gunTurret.anchorX=0.22   

gunTurret.anchorY=0.714    

gunTurret.x = 22–92  

gunTurret.y = 698–645  

gunTurret.rotation =0

gunTurret:setMask(mask)  

I suppose you’re using zoomStretch scaling? That will deform images to fit the resolution of the device.

See http://docs.coronalabs.com/guide/basics/configSettings/index.html

I am using scale=“stretch”

“stretch” is not a valid value for the scale, so it will default to zoomStretch. Using stretching will do just that - stretch the picture to fit the device, potentially deforming it if the aspect ratio of the device is different from whatever you are using in your config. That is the effect you are seeing.