media file sizes

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
original_ninja
Posts: 5
Joined: April 24th, 2006, 12:37 am
Location: Florida, USA
Contact:

media file sizes

Post by original_ninja »

i love battle of wesnoth. and i think the media is incredible, but i've noticed that the game images and sound take up almost 50% of the entire size of all game data. if the image files were converted to a lower bit at final run or even *.gif, couldn't that potentially save some space? i dont know if there is anything much that could be done with the media files, since it seems that *.ogg is the standard in open source audio, perhaps some form of compression?
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

The files are already compressed as much as they can be in the .png format. We don't use .gif, IIRC, because it isn't Free, so there are no Free graphics libraries that can display .gifs.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
zaimoni
Posts: 281
Joined: January 27th, 2005, 7:00 am
Location: Linn Valley, KS U.S.A.
Contact:

Post by zaimoni »

The UNISYS patent on LZW-78 (which is what *.GIF trips on) has mostly expired, although the date varies by country. The patent expired on June 28, 2003 in the U.S. EU, Canada, and Japan all saw the patent expire somewhen in June 2004, assuming no last-minute renewals and that the EU really can be treated uniformly. Cf. http://news.bbc.co.uk/2/hi/technology/3007862.stm.

More critically, *.GIF is limited to 255 colors for images with index transparency. *.PNG supports truecolor images and alpha transparency, and is simply a superior format for Wesnoth. Filesize problems aren't an issue after running pngcrush with the --brute option.

As such, there's no need to use a nonstandard libjpeg-6b, with *.GIF support imported from from libjpeg-6a, in building libpng.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

zaimoni wrote:More critically, *.GIF is limited to 255 colors for images with index transparency. *.PNG supports truecolor images and alpha transparency, and is simply a superior format for Wesnoth. Filesize problems aren't an issue after running pngcrush with the --brute option.
Indeed. We need proper transparency, .gif doesn't have that.
User avatar
irrevenant
Moderator Emeritus
Posts: 3692
Joined: August 15th, 2005, 7:57 am
Location: I'm all around you.

Re: media file sizes

Post by irrevenant »

original_ninja wrote:i love battle of wesnoth. and i think the media is incredible, but i've noticed that the game images and sound take up almost 50% of the entire size of all game data.
I think this is essentially a truism. Images and sound are, by their nature, big files - even when compressed (which they already are in Wesnoth), and you'll find that in almost all games the bulk of the data is images or sound (or animations). It should be noted that .ogg is a compressed format, just like MP3.

I think this answers your questions, unless anyone has something to add?
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

I guess I would add that some packagers come out with a "Wesnoth lite" distribution, which leave out the superfluous graphics and sound.
turin wrote:The files are already compressed as much as they can be in the .png format. We don't use .gif, IIRC, because it isn't Free, so there are no Free graphics libraries that can display .gifs.
Gif is better than Free; it's public domain. It's just not that good.
Hope springs eternal.
Wesnoth acronym guide.
original_ninja
Posts: 5
Joined: April 24th, 2006, 12:37 am
Location: Florida, USA
Contact:

Post by original_ninja »

i took the liberty of doing a little test work, and i dropped the *.png image to 32,000 colors, and there was about a 15% gain, without any critical changes in quality. at 256 colors its about a 50% gain, but the quality is noticeably different. do we really need to use *.png at its fullest? i started this topic, because i use dial-up, but i like to stay up-to-date with wesnoth, and whenever a new version is released, the download is always quite large. and yes i've noticed that a few distro's have a "lite" version, with images of lesser quality. i manage a general purpose server, and among other things, it runs a wesnoth server, so downloading a binary and the source is almost triple the size of downloading a single binary, :-/.
zaimoni
Posts: 281
Joined: January 27th, 2005, 7:00 am
Location: Linn Valley, KS U.S.A.
Contact:

Post by zaimoni »

As for 32,000 vs. truecolor...I have inadvertently implemented web site designs that broke in 16-bit color display from this. It was very difficult to fix. Technically, I don't think the risk is worth taking.

[restricting the colors worked in truecolor displays, but looked awful in 16-bit.]

"Critical difference" is often in the eye of the beholder. I'd rather trust trained eyes than mine...that is, the artists' eyes.
freim
Retired Terrain Art Director
Posts: 1113
Joined: November 29th, 2003, 11:40 pm
Location: Norway

Post by freim »

original_ninja wrote:do we really need to use *.png at its fullest?
Yes.

Degrading the quality of any aspect of the game for everyone to cater to some minority of users will not be done, period.

Anyone has the freedom to distributed a trimmed down version of Wesnoth as long as they comply to the GPL.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

And it's not even all about quality - using .png at it's fullest means that people can more easily work with the graphics directly (so they wouldn't need to download another "unoptimized" set to work with them). This is pretty important, since we have minor contributors who need to be able to just take the existing graphics and improve them easily. If the colour spaces for example are changed while optimizing, this would most likely result in all kinds of little colour errors in the long run when a lot of people would edit the images with different software, etc.
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

Wow. I am surprised that sound and images only take up 50% of game data. Clearly we need to look into compressing the other data more.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Darth Fool wrote:Wow. I am surprised that sound and images only take up 50% of game data. Clearly we need to look into compressing the other data more.
Translations! They're huge! 50% isn't accurate, though. I wonder if he took the size of the data directory as all data. It's mostly campaign images.
Hope springs eternal.
Wesnoth acronym guide.
User avatar
Casual User
Posts: 475
Joined: March 11th, 2005, 5:05 pm

Post by Casual User »

scott wrote:I guess I would add that some packagers come out with a "Wesnoth lite" distribution, which leave out the superfluous graphics and sound.
May I ask where one may download "Wesnoth lite". I would be very interested.

Not only would I be interested in a smaller download, but I have a slight aversion to any animation that is more than one frame long, so I would probably enjoy a Wesnoth where superfluous graphics have been removes.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Iwa is the only one still making the lite version (OS X). There used to be a wider selection of lite versions, but they weren't popular, so they quit making them. You would have to ask your packager to make one for you.
Hope springs eternal.
Wesnoth acronym guide.
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Post by Eleazar »

zookeeper wrote:And it's not even all about quality - using .png at it's fullest means that people can more easily work with the graphics directly (so they wouldn't need to download another "unoptimized" set to work with them). This is pretty important, since we have minor contributors who need to be able to just take the existing graphics and improve them easily. If the colour spaces for example are changed while optimizing, this would most likely result in all kinds of little colour errors in the long run when a lot of people would edit the images with different software, etc.
Exactly. This is, i believe one of the secrets of Wesnoth's success. No special tools or process is needed to work on the graphics. You just open up the images in a semi-decent editor and go. Images can be (and are) iterated hundreds of times with no loss of quality (other than human error). The artist is not required to install special graphics librarys or learn a new program. The gain to Wesnoth in attracting and keeping new artists well outweighs the extra megs spent on DLing.

Since a disproportionate amount of the FOSS game art talent works on Wesnoth, i think we're doing a lot of things right.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
Post Reply