Strange issue with PNGs
Paxton
Member Posts: 89
I am making my PNGs in Photoshop and compressing them afterwards with TinyPNG so that my game won't get bloated in size.
However, when putting the compressed PNGs in Gamesalad, they seem to have a white border around them. If I transfer the project to the iPhone (ad hoc testing), the white edges are not visible at all.
Is it possible that the Gamesalad Mac Preview renders thess PNGs wrong, and the iPhone does so correctly? On the iPhone 5s that I have for testing, these white edges are not visible at all, but I am not sure about bigger screened iPhones.
Comments
Generally speaking GameSalad doesn't support compressed PNGs. Although your game (on disk) will be smaller with compressed images, it won't make any difference to your game when in RAM / when running, as the images will be held in 24bit/32bit colour space . . . . so a 4MB image on disk will occupy a 4MB chunk of memory in RAM, a 4MB image compressed down to 128kb will also occupy a 4MB chunk of memory in RAM.
There is also the question of decompression, I'm not sure how GS compress your images on publishing (they do some level of compression), but some formats will have the additional overhead of decompression time, so in theory there will be situations were a compressed image not only takes up the same amount of RAM as an uncompressed image, but will also need to be decompressed in real time, which might impact performance depending on the particulars of the game.
Also, factor in the quality loss inherent in most compression (although it can be minimal).
So, the only real saving you are making with compressed images is a smaller disk footprint, in my humble opinion this really shouldn't be an issue in a world where memory sizes grow and grow with each new phone release, and internet speeds increase by the month, most (non-technical) people these days won't notice (or care about) the difference between a 32MB game and a 58MB game.
@Socks I get your point on compression, but this is not about RAM usage as much as it is about keeping under 100mb (Apple's limit on downloads over cellular network).
I was trying to figure out if the GS Preview on Mac renders PNGs differently than PNGs are rendered on the iPhone.
In Preview, some assets have white edges. They do not appear visible on iPhone. Is that even possible?
They should render identically.
Like I say, GameSalad doesn't support compressed image formats, best to stick to PNGs and PSDs.
@Socks they are still PNGs, even the compressed ones. They are just smaller in size!
Why wouldn't GS support compressed images, if they are still in the PNG format? The smaller versions (compressed) have some very slight visual alterations that I can deal with.*except the white edges which appear to be only in Preview on Mac
Yes they are smaller, and yes they are PNGs, but unfortuntely GameSalad doesn't support compressed image formats.
Imagine this is an image size issue . . .
A: "GameSalad doesn't support images larger than 2048 x 2048 px"
B: "But my images are PNGs, why wouldn't GS support large images, if they are still in the PNG format ?"
GameSalad will happily ingest PNGs, but compressed PNGs are not supported, I expect the image issues you are seeing are caused by this incompatibility, and I guess there is also a risk that in other scenarios (different devices, different iOS versions, etc) the results might be unpredicatable.
As far as I understand it, from version 14.0 onwards (with the new rendering system) you won't even save any memory on disk with compressed images as all image assets are recompressed to LZ4_HC, so by first compressing with something like Tiny PNG all you will be doing is reducing the quality of the image a little, with no saving on disk space or RAM usage.
@Socks ok, makes sense. Thanks.
Leaving that aside, how do you then keep the game at a reasonable size then? Half of a background asset is about 400kb fresh out of photoshop, and I use 2 in each scene to have a full background.
My game has a bit of variety in it, and without compression it will spin out of control in terms of size... I mean,is there even a solution to this?
I'm not 100% sure what the question is ? What is a reasonable size ?
I'm not good with vague terms like 'reasonable size' or 'spin out of control' (give me numbers !! ).
The answer to a large game is Wi-Fi, Apple's app size limit is (as far as I remember) 2GB, people spend a lot of time trying to squeeze (read 'compromise') their games so as to fit over a mobile network, but if someone wants to download your game and it's 220MB I'm sure they will, everyone has Wi-Fi at home, every café and department store and train station and airport and office (etc etc), so downloading over Wi-Fi is about as easy as downloading over mobile - at least here in London - I suppose you have to make a choice, you can cut back on some game elements if you specially want your game to be downloadable over a mobile network / less than 100MB.
It's worth bearing in mind that games as large as 500MB, 1GB and even 1.5GB often sit at the top of the App Store charts, like I say above, I really think game size is not a consideration for most people, the first time they'd even notice the size would be when they get a pop up saying 'this game is too big to fit onto your device' because their mobile device is full, at which stage they would likely just delete a few old apps or otherwise clear a bit of room for the new stuff.
http://forums.gamesalad.com/discussion/81470/tinypng