Jump to content
  • Advertisement
taby

Billboard-resolution, TGA format limitation

Recommended Posts

Posted (edited)

Unfortunately, the Targa TGA format only supports widths and heights up to 65535 pixels (or, 5.55 metres at 300 pixels per inch), stored as a couple of short unsigned ints in the TGA header data.

Do you have experience with a simple format that doesn't have such a limitation?

Edited by taby

Share this post


Link to post
Share on other sites
Advertisement

Are you sure you need this? Images of that dimension easily run into the gigabytes and might choke up the average computer. You also likely want to use compression on such a thing, which kind of eliminates the 'easy' options.


Not sure what you're aiming at but it's probably more manageable if you cut it up in sections and use a library that works with a more common format (TGA is rather old and superseded). Decoding file formats is a nice exercise but usually a waste of time.

Share this post


Link to post
Share on other sites

Yeah Photoshop is bad enough at eating all my RAM without trying to load a 16GB TGA file... 🥺

If a game needs textures bigger than that, you'll probably need to build a system that lets you edit it as small sections before assembling the full image, so that artists don't need a terrabyte of RAM in their development PCs.

Then, seeing as you're now doing custom tooling, you could also just use a modified TGA with 32bit width/height fields?

Share this post


Link to post
Share on other sites

What is the use case, out of interest? :) 

Another vote for a tiled or some other approach here. Aside from the GB used, with flat images that size, you are going to be killing your caches too presumably as going from 1 y line to the next will likely be > 256K, and how are you going to edit it?

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks for the information, all.

I will just use multiple TGA files if I ever need to go beyond 5.55 metres.

It also turns out that the BMP format uses a long unsigned int for storing the number of pixels per dimension, and the limit is like 363.64 kilometres at 300 ppi.

Edited by taby

Share this post


Link to post
Share on other sites
Posted (edited)

I wonder what the ppi for the Fremont Street Experience is... and man, that canopy is long! 8th Wonder.

Edited by taby

Share this post


Link to post
Share on other sites
24 minutes ago, taby said:

I wonder what the ppi for the Fremont Street Experience is... and man, that canopy is long! 8th Wonder.

According to the official numbers, it works out to just 1 pixel per inch.

Which is still pretty ridiculous, given how big it is.

Share this post


Link to post
Share on other sites
Posted (edited)

@swiftcoder -- Sweet!

@lawnjelly -- The use case is to create a print, and display that art on an actual billboard.

@Hodgman -- Yes, there is always the option of creating a new format. Thanks for pointing that out, it's very handy.

Edited by taby

Share this post


Link to post
Share on other sites
3 hours ago, taby said:

and the limit is like 363.64 kilometres at 300 ppi.

That's a 75 exabyte image, by the way.

In practice very few prints go even into the max size of a TGA file - print costs scale even faster than memory costs, making it economically problematic to print even multi-gigabyte images at full resolution.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!