Jump to content

PNG sprite sheet wider than 8192?


tsphillips
 Share

Recommended Posts

Happy Tuesday!

 

I need to support a PNG sprite sheet wider than 8192 pixels.  Adobe Photoshop does not seem to like images that big when "saved for web."  Does anyone know what browsers may or may not choke on loading an image wider than 8192 pixels?  The image would never display as a whole, but I need to find out whether the browser parsing of the PNG image would break down.

 

Tom

 

Link to comment
Share on other sites

If you're never displaying it then the only problem will be if the .PNG parser in the browsers is limited.  If it's using a 16 bit value to represent the x coordinate and that's being multiplied by the pixel depth (4 bytes per pixel usually) then you should still be ok to 16k pixels horizontally (16k * 4 = 65536). However there are many other possible limits that could be applied by the browser implementation.

Have you considered loading your huge image as binary data?  Then there would be no limit (except RAM) and you could use better compression algorithms (eg. zip) to keep the file size down.

You'd have to roll your own (or grab someone else's) image processing code, but uncompressed PNG is a very simple format (just slap a stock header in front of the pieces of your raw data that you want to process as images).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...