tsphillips Posted January 20, 2015 Share Posted January 20, 2015 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 More sharing options...
valueerror Posted January 20, 2015 Share Posted January 20, 2015 according to the latest webgl stats only 35 % of browsers support texturesizes greater than 8000 px .. so it's save to say.. don't !! you know that you can use more than one row in a spritesheet? instead of 8000x100 make it 4000x200 or use a texture atlas instead.. Link to comment Share on other sites More sharing options...
InsaneHero Posted January 21, 2015 Share Posted January 21, 2015 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 More sharing options...
tsphillips Posted January 21, 2015 Author Share Posted January 21, 2015 Thanks for the input -- we ended up splitting the row into three separate rows. It was a bit more tedious on the art side and some extra complexity, but nothing too difficult. Tom Link to comment Share on other sites More sharing options...
Recommended Posts