Image is being Pixelated

Hi,

I have the following three sprite sheets

  1. sheet.png
  2. sheet@2x.png
  3. sheet@4x.png

its working fine on iPhone4,iPhone4s ,samsung galaxy s3 and s4 but not on iPad and galaxy tabs. The images are looking blurry and pixelated. Is there anything wrong I’m doing?

Below is my config.lua

application = {
   content = {
      width = 320,–aspectRatio > 1.5 and 320 or math.ceil( 480 / aspectRatio ),
      height = 480,–aspectRatio < 1.5 and 480 or math.ceil( 320 * aspectRatio ),
      scale = “letterBox”,
      xAlign = “center”,
      yAlign = “center”,

      imageSuffix = {
         ["@2x"] = 1.5,
         ["@4x"] = 3,
      },
   },
}

For more, please see the attached images.

Thanks in advance.

Experiment with this (Before rendering any images): http://docs.coronalabs.com/api/library/display/setDefault.html#texture-keys

Specifically min/mag- TextureFilters.

However, It looks like your’re using zoomStretch scaling.  If so, you will see issue with textures.  The device is doing its best to make the image fit the screen which involves stretching the image and filling in ‘extra’ pixels using nearest-neighbor approximation or some other technique. 

Hi @asim1,

Can you please confirm that the @4x image set is being loaded on the iPad and Galaxy Tab? In your code, please add this and check its value:

[lua]

local suf = "SUFFIX = "…display.imageSuffix

local suffix = display.newText( suf, 0, 0, native.systemFont, 16 )

suffix.x, suffix.y = display.contentCenterX, 100

[/lua]

If the tablets are not showing “@4x” for this value, then they’re not loading the proper image assets based on your config setup, so you’d need to adjust that to make the app aware of which assets it should be using.

Take care,

Brent

This worked. Thanks for your great help :slight_smile:

Experiment with this (Before rendering any images): http://docs.coronalabs.com/api/library/display/setDefault.html#texture-keys

Specifically min/mag- TextureFilters.

However, It looks like your’re using zoomStretch scaling.  If so, you will see issue with textures.  The device is doing its best to make the image fit the screen which involves stretching the image and filling in ‘extra’ pixels using nearest-neighbor approximation or some other technique. 

Hi @asim1,

Can you please confirm that the @4x image set is being loaded on the iPad and Galaxy Tab? In your code, please add this and check its value:

[lua]

local suf = "SUFFIX = "…display.imageSuffix

local suffix = display.newText( suf, 0, 0, native.systemFont, 16 )

suffix.x, suffix.y = display.contentCenterX, 100

[/lua]

If the tablets are not showing “@4x” for this value, then they’re not loading the proper image assets based on your config setup, so you’d need to adjust that to make the app aware of which assets it should be using.

Take care,

Brent

This worked. Thanks for your great help :slight_smile: