background image on iPhone

jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
I've got a really long background image: 320 x 2900. When I play in Safari, it looks nice and crisp. When I play on the iPhone, it's blurry. I saw somewhere that you can't have an image bigger than 1024, should I split this image up into 3 separate ones and just lay them next to each other?

Comments

  • JGary321JGary321 Member Posts: 1,246
    Yes, because Apple will reject anything with an image over 1024 x 1024. As far as the blurriness it's a bug that will be fixed soon hopefully. Edit the actor instance & make the X,Y offset by .5

    So if it's at X 400 & Y 300 then make it 400.5 & 300.5
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I tried editing the x & y position of the actual actor, it's my background and it was previously set at 0,0. I changed it to 0.5,0.5 but nothing changed it's still blurry, is that what you meant?
  • JGary321JGary321 Member Posts: 1,246
    Not the actor itself no, put the actor in the scene & then double click on it. The actor that's in the scene is called an instance of the original actor. So you edit the X/Y of the instance.
  • JamesBoucherJamesBoucher Member Posts: 433
    I have images in my games that are 1440 X 960 and they did not get rejected, and they work fine. I did not develop the games with GameSalad. I've seen this 1024 image size limit post before, and it's not true.
  • sdparduesdpardue Member Posts: 110
    Not sure if this is relevant to your situation with blurry images, but...

    I've inadvertently created blurry images in Photoshop, when I "Save As" a .png. They look fine in Photoshop, in Preview, etc., but are blurry in GS.

    However, when I "Save For Web & Devices" instead, all is well.

    Haven't had to do the 0.5px offset. BTW, my experience is with using GS for web deployment, not the iPhone, yet.
  • JGary321JGary321 Member Posts: 1,246
    Personally, I'll stick to the 1024 x 1024 rule. Here's some info scoured from the web.

    http://gamesalad.com/wiki/game_elements#how_big_can_i_make_my_image

    http://kuon.goyman.com/2009/01/22/iphone-large-image-viewer/
    For one of my iPhone project, I had to view large images of about 2500×2500 pixels, which is tricky because UIImage and UIView doesn’t support size above 1024×1024.

    http://bindapple.com/iphone-comics/
    Each page is roughly three times the size of the maximum image that the iPhone can easily display (1024×1024 pixels). If the large images are used on the iPhone, they must be broken into smaller pieces and shown to the user as they scroll throughthe page. This takes up a lot of processor time. Processor=battery so the battery life suffers.”
    What size can textures be?
    Textures must have power of two dimensions less than or equal to 1024 e.g 2,4,8,16,32,64,128,256,512 and 1024.
    So 16×256 is okay, 512×512 is okay but 240×320 is not.
    Additionally if you want to use compressed (PVRTC) textures they must be square.

    http://www.cocos2d-iphone.org/wiki/doku.php/faq
    You can still use an image that does not follow these rules but beware that it will be stored in a texture with power of two dimensions. So loading a 240×320 images will result in a 256×512 texture being created.
    On newer platforms (such as iPhone 3GS) a maximum texture size of 2048×2048 is supported, however, the Texture2D class that performs texture loading has a hard coded maximum of 1024.

    http://discussions.apple.com/thread.jspa?messageID=7712958
    There is one imagepicker call to get an album picture, one to get a camera picture and one for camera roll. All supply a UIImage even using the uncropped version as you're doing.
    UIImage is limited to 1024. (Check the ref document)
    All of these routines pass back smaller images than what went in.
    Currently there is no way around this within the SDK that I am aware of.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    See, my png's are perfectly clear in GS and in the web view, I used that Save for Web and Devices.

    I've tried resaving them as higher quality PNGs, I've confirmed that the images are at native size and not stretched.

    Last thing I need to try is splitting the images so it isn't one huge image.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Are you following the 72dpi rule? It's a FAQ
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    ehh, it didn't seem to work, I tried resaving all my background images into a new 72DPI 320x2900 pixel image as both PNG-8 and PNG-24, but they call came out blury.

    I'm using Photoshop, does that incorrectly save 72dpi as 72.1dpi like Preview does?

    Strange thing is, my 320x480 background images work fine, and those should be the same as the 320x2900 ones, DPI and everything.

    I'm doing all this work over a VPN connection back home, so it's not the easiest thing to do, I think during lunch I'm going to attempt to split the image into 3 sections and see how that goes.

    Anyone have any other suggestions to try?
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    do you have the version of GameSalad 0.5.0 that is on the download site? I think it already has the fix for some of the graphics issues that needed the .5 instance adjustments JGary was talking about.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Hi CodeMonkey,

    Yes, I downloaded it this morning so I could work on my laptop, but I think I fixed it. Splitting up the image into three 72DPI 1000px segments worked. I'm not sure why it didn't like my original image, it must have just been too big.

    Thanks for all the help everyone
Sign In or Register to comment.