webp instead of png?

5 replies [Last post]
jose1711
User offline. Last seen 3 years 32 weeks ago. Offline
Joined: 2008-06-20
Posts: 80

now that webp supports transparency (http://code.google.com/intl/sk-SK/speed/webp/gallery2.html) will hedgewars be switching to this format to save some space? jose

Koda
Koda's picture
User offline. Last seen 10 weeks 5 days ago. Offline
Joined: 2008-11-10
Posts: 215

no.

jose1711
User offline. Last seen 3 years 32 weeks ago. Offline
Joined: 2008-06-20
Posts: 80

hmm.. shame.

$ for i in Snow.png NapalmBomb.png TARDIS.png; do ./png2webpll -c 100 -o ${i%%png}.wpl $i; done
png = 152, webpll = 45 bytes (0.296053)
png = 1501, webpll = 1144 bytes (0.762159)
png = 6420, webpll = 3926 bytes (0.611526)

is this a definite answer or i should read it more like 'not until it's supported by fpc'?

jose

nemo
nemo's picture
User offline. Last seen 3 weeks 3 days ago. Offline
Joined: 2009-01-28
Posts: 1861

Oh. Nice. They made webp a bit less sucky.
It is now up to where JNG was a decade ago Wink Smiley

Anyway. fpc isn't the issue, it would be cross-platform support by SDL that would be.
Still, artifacts are artifacts. Only some images would be appropriate to reencode, assuming of course the good cross-platform support for the lossy format. Do it to a map, and you'd have weird little unexplained roughness to the terrain. Backgrounds would be safe, and land textures.

And, it won't just be SDL, if we get the web port underway, would need good support in all browsers for the lossy format.
Probably the safest would be to just use 2 JPEGs - one for RGB and a single greyscale one for the alpha. That's the way already to get lossy RGBA online in a cross-browser way since the death of JNG (canvas + 2 JPEGs).

Certainly this has been possible for a while. It hasn't happened because... Well, no one has cared that much. PNG allows safe repeated edits and saves, lossy formats do not. The savings in size aren't that significant for things that are not redownloaded that often.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

jose1711
User offline. Last seen 3 years 32 weeks ago. Offline
Joined: 2008-06-20
Posts: 80

as for the artifacts: i was referring to lossless version (still experimental) of webp. i do not think any lossy compression would be good for hedgewars graphics either. so let's see whether webp support in sdl/browsers will improve in time.

nemo
nemo's picture
User offline. Last seen 3 weeks 3 days ago. Offline
Joined: 2009-01-28
Posts: 1861

Ah. Gotcha.
Another thing to consider of course is accessibility. Right now anyone can edit a PNG in anything.
As well as browsers and SDL, there's also acceptance in GIMP and Inkscape (yes, import + trace) to consider. And, oh, Photoshop for those
folks using that...

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]