Nook Jpeg 2000 and GIF Files Errors

I recently completed my app, tested it on the iPad and uploaded it to Apple for review.All throughout the development and testing the app worked perfectly in all simulator modes including Nook, Kindlefire, etc. However, when I loaded the app on my Nook tablet and tested it the app breaks when Jpeg 2000 (.jp2) images files are used. According to the documentation (Android) GIF files are supported so I tried replacing the Jpeg 2000 files with GIF files but they also do not work.

When the app goes to load a Jpeg 2000 or GIF file the image file does not get loaded and the functionality gets messed up and the app has to be restarted. I used Jpeg 2000 images in place of PNG files to reduce the app size considerably where I need images that support transparencies.

Has anyone else run into these problems on the Nook? Any suggestions? I can’t use the PNG files because the app will exceed the 50MB limit for the Nook store.

Thanks.

[import]uid: 104904 topic_id: 28304 reply_id: 328304[/import]

I don’t know about the Nook texture issues but there are ways to reduce the size of png files that might get your app under 50MB.

For example, TexturePacker has options to adjust the bit depth of the png files output. If you are currently using full 32bit pngs (RGB8888) you could try RGB5555 and shave off about 25% of the resulting file size with barely noticeable loss in quality, or even try RGB5551 to reduce the size almost 50%. RGB5551 outputs a 1 bit alpha channel so you wont get clean alpha edges or alpha gradients on your images, but if you are hovering just above the 50MB footprint you could pick a few images to reduce and get under the limit.

If you have Photoshop and easy thing to try would be “Save for Web…” from the file menu, and select PNG-8. That will convert your image to an indexed image with a one bit alpha channel. Again, you won’t get clean alpha edges but it does reduce the file size over 50% from standard RGB8888. I personally haven’t used this method so don’t know if it works on the Nook or other devices, though it does work in the simulator.

I don’t have Adobe Fireworks but apparently that program has many more options to reduce/reconvert PNG files, incuding PNG8 files with full apha transparency which would give you back your clean alpha edges.

Just fyi, all images get converted back to full RGB8888 when used in a Corona app so these techniques won’t reduce the texture memory used by your app, just the download size. [import]uid: 9422 topic_id: 28304 reply_id: 114350[/import]

Thank you for that info. I downloaded TexturePacker but was unable to just load an image, convert it and save it in one of those formats. There’s no help and it is not at all intuitive as to how this is done. It wants to convert the image to a sprite which is not what I need and I don’t see how I can specify a (single) image format on the save.

Any advice how to accomplish the above?

Thanks.

Dan [import]uid: 104904 topic_id: 28304 reply_id: 114392[/import]

True, TexturePacker is mainly for creating sprite sheets and is not designed specifically as a texture conversion tool, but it can be used as such. Give this a try:

First make sure your original texture pixel dimensions are a power of two, like 256x512, 1024x1024, etc. Corona increases the dimensions of any texture that is not a power of 2 until it is so you might as well start with that. So if your original texture is, for example, 500x200 pixels just increase the canvas size or scale the image so it is 512 x 256 pixels.

Then in TexturePacker start a new file. Drag the PNG image you want to convert to the right hand ‘sprites’ window. In the texture settings window, under ‘Output’ set the Texture format to PNG, Image format to the PNG format you want to convert TO ( like RGBA5551 ), and set the path to where you want to save it to using 'Texture file … '. Under ‘Geometry’ turn off autosize, and set the fixed width and height to the pixel dimensions of your original png. Under ‘Layout’ make sure all paddings are set to 0. None of the other settings should matter but you might want to experiment to see what they do to your resulting image.

Now press the ‘Publish’ button and the new png should be generated and placed in the directory you specified.

I wouldn’t want to convert hundreds of images using this method, but it’s a pretty quick way to convert a few images. Photoshop and Fireworks have ways to automate image conversions using a batch process. [import]uid: 9422 topic_id: 28304 reply_id: 114398[/import]

Once again thank you for your advice. In the end I downloaded Fireworks and am using it during the trial period. It works simply and perfectly in reducing my 32 bit PNG’s to 8 bit versions and, as I have quite a few files to process, having the batch capability makes a huge difference.

I’m still curious as to why GIF files do not work. I wonder if that might be a Corona bug as the Android documentation specifies GIFs as a supported image file format. [import]uid: 104904 topic_id: 28304 reply_id: 114409[/import]

Make sure to test a couple converted images on your target devices before going too far down any one path. I just saw something in the docs about Corona NOT supporting indexed PNGs. Maybe that’s changed and they haven’t updated the docs, or… 8 bit indexed PNGs simply might not work on actual devices.

In the case of GIFs, while Android might support them I wouldn’t be surprised if Corona doesn’t. It’s also frustrating when the simulator supports things that the devices don’t, but that’s bitten me more than a few times. So, again, my advice is to test on devices early and often!

[import]uid: 9422 topic_id: 28304 reply_id: 114416[/import]

I did and so far they do work hence my previous post. I’m not using indexed (transparency) PNGs but alpha transparency PNGs. I’ll update this post if anything else comes up.

The other thing I noticed is the poor performance on the Nook in general. The device is much slower on its own than the iPad and my program is noticeably sluggish on it. And, my program is doing very simple processing so the cause must be a combination of the Corona Nook implementation and the inherent Nook technology. There are some areas of the code where I can and will tweak to compensate as best I can but the app will never perform as well on the Nook until B&N and/or Corona improve their technologies.

BTW - Corona does support GIFs. They work fine in the simulator. But when loaded on the Nook they don’t in spite of the Android documentation. [import]uid: 104904 topic_id: 28304 reply_id: 114480[/import]