Page 1 of 1

New Texture File Extensions!

Posted: Sat Oct 24, 2009 10:34 pm
by enrico123
what I find a very big problem for bzflag is that on textures etc
you can have the .png file extension only and that really bugs me because most images are in .jpg or .JPEG and I think they should add more avaidble file types for textures

who else agrees with me.....

Re: New Texture File Extensions!

Posted: Sun Oct 25, 2009 1:01 am
by Gamma
It would make it a bit easier but for right now if you want a pic thats in jpg format then just install gimp, open the pic, then export as a png.
Thats what I do. :wink:

Re: New Texture File Extensions!

Posted: Sun Oct 25, 2009 1:45 am
by blast
There are hundreds of image converters. XnView is a pretty nice one, and it can read hundreds of formats. ;)

Also, if you intend to host any images on the official BZFlag image site, then they can't just be random images you find on the Internet. They have to be images that are released under an open license.

Re: New Texture File Extensions!

Posted: Wed Oct 28, 2009 3:45 pm
by War Pig
If you are on linux, ImageMagick is free and will do the job:

Code: Select all

#convert filename.jpg filename.png
GIMP is another option already suggested.

While it would be really easy to have the server automatically convert any uploaded image to png format using a similar method either by calling 'convert' or using the built in PHP image manipulation functions, I think I'd require the uploader to upload the required format. Would avoid the whole 'your conversion made my textures look bad' scenario.

WP

Re: New Texture File Extensions!

Posted: Wed Oct 28, 2009 8:20 pm
by Gamma
And if my mem proves right isn't png format higher quality than jpg? :shock:

Re: New Texture File Extensions!

Posted: Wed Oct 28, 2009 8:29 pm
by joevano
Depends on what you are displaying. JPEGs are for photographs and realistic images. PNGs are for line art, text-heavy images, and images with few colors. You can have photos in PNG format, but the file size will be much larger that a JPEG with no real noticeable difference in quality. The same does not hold true for text and line art being used in a JPEG, as this cartoon illustrates: http://lbrandy.com/blog/2008/10/my-firs ... -webcomic/

Re: New Texture File Extensions!

Posted: Wed Oct 28, 2009 9:15 pm
by Runic
FYI, JPEG is a compression scheme, not a file format. JPEG File Interchange Format (JFIF) is a file format - I know everyone just calls them JPEGs though

PNG was design as a replacement for GIF, mainly because of COMPUSERVEs copyright on GIF

PNG supports 8-bit transparency where JFIFs don't
(must use 24-bit color to have a mask, I'm guessing 48-bit color support a mask too)

Both JFIFs and PNGs use compression but PNGs compression is lossless, while JFIFs is lossy

PNGs can support 8, 24 and 48-bit color (mostly you will see either 8 or 24 bit color PNGs)
GreyScale PNGs support 1,2,4,8 and 16-bit grey color

JFIFs support 8, 16 and 24-bit color - (no mask)
JFIF Greyscale supports 8-bits of grey color (no mask)

GIFs support 8-bit color 1-bit mask
(GIF mask is not a separate channel, it is a single color included in the 256 color max)

1-bit = 2^1 = 2 colors
2-bit = 2^2 = 4 colors
4-bit = 2^4 = 16 colors
8-bit = 2^8 = 256 colors
16-bit = 2^16 = 65,536 colors
24-bit = 2^24 = 16, 777, 216 colors

I would recommend using a PNG if you can first, JPEG second and GIF last, of course for bzflag there is only one to use, PNG!

you could write a server side script or CGI to convert your JPEGs on the fly to PNGs if you really want to use them with out have to re-save each of them and then point the texture to the script instead of the actual image - the script of course would need to be passed the image path you really want to use for the texture.

Re: New Texture File Extensions!

Posted: Mon Jan 25, 2010 2:02 am
by hutty
I think that more file formats should be available.

while png is higher quality and supports great transparency, jpg would work better for the larger images greatly reducing file size. while for gifs, the copyright restrictions have been lifted (if i am correct), would leave a much easier way to do animation than dynamic color

Re: New Texture File Extensions!

Posted: Mon Jan 25, 2010 1:39 pm
by joevano
huttymuncher wrote:while for gifs, the copyright restrictions have been lifted (if i am correct)
Huh, copyright restrictions have not been lifted... where did you see that?

Re: New Texture File Extensions!

Posted: Mon Jan 25, 2010 1:46 pm
by hutty
multiple places

Re: New Texture File Extensions!

Posted: Mon Jan 25, 2010 4:24 pm
by joevano
huttymuncher wrote:multiple places
Provide specifics, don't spread hearsay that is not true here.

Re: New Texture File Extensions!

Posted: Mon Jan 25, 2010 6:13 pm
by JeffM
jpeg sacrifices quality for size. On textures that get scaled in game this does not look good.

Being able to read GIF files does not infer automatic animation ability in game, that would have to be written in. PNG will have better compression then GIF for 8 bit images (GIF is only RLE, PNG is GZIP). We could do animation with PNG if needed.

The other issue is that supporting those formats would require more third party libraries, and we do what we can to minimize those.

The one good format to support would be SVG.

Re: New Texture File Extensions!

Posted: Mon Jan 25, 2010 10:41 pm
by tobylane
http://en.wikipedia.org/wiki/Gif Expired patents.

Does the game support Animated pngs?

Re: New Texture File Extensions!

Posted: Mon Jan 25, 2010 11:24 pm
by JeffM
not at this time.

Re: New Texture File Extensions!

Posted: Tue Jan 26, 2010 12:26 am
by joevano
tobylane wrote:http://en.wikipedia.org/wiki/Gif Expired patents.
The patent for the TECHNOLOGY expired, copyright is for the creative content. Know the difference, the law does.

Re: New Texture File Extensions!

Posted: Tue Jan 26, 2010 3:20 am
by Spazzy McGee
JeffM wrote:The one good format to support would be SVG.
Oh, yes please!

Re: New Texture File Extensions!

Posted: Tue Jan 26, 2010 3:38 am
by Gamma
Spazzy McGee wrote:
JeffM wrote:The one good format to support would be SVG.
Oh, yes please!
I know what the SVG format is but why would it be so good? correct me if I'm wrong but the last time I read it was primarily being used for mobile phones. (not to get off topic) :D

Re: New Texture File Extensions!

Posted: Tue Jan 26, 2010 3:58 am
by Spazzy McGee
Gamma wrote:I know what the SVG format is but why would it be so good? correct me if I'm wrong but the last time I read it was primarily being used for mobile phones. (not to get off topic) :D
It's a vector graphics format - that is, images are not defined by pixels of specific shades; they are defined as coordinates, shapes, and colours etc. etc. The advantages to this are that you can infinitely scale an image, and it will always look nice, as the image is being rendered on the screen for you (much like a bzflag map is, in a 3D space, the image is rendered in a 2D space).

It's useful for undetailed textures and patterns, because it's generally a lot smaller than 'raster' graphics, and as stated above, can be infinitely scaled.

Re: New Texture File Extensions!

Posted: Tue Feb 09, 2010 10:43 am
by a bag of hurt
"The US LZW patent expired on June 20, 2003.[18.. Consequently, while Unisys has further patents and patent applications relating to improvements to the LZW technique,[18] the GIF format may now be used freely."

-Wikipedia

However, GIFs are not really the best option for anything at this point. PNG is a good choice for any bitmap images, although its (lossless) compression works best on images with a lot of solid colors.

I agree that the development time would be better spent on other issues.

Re: New Texture File Extensions!

Posted: Tue Feb 09, 2010 1:05 pm
by joevano
a bag of hurt wrote:"The US LZW patent expired on June 20, 2003.[18.. Consequently, while Unisys has further patents and patent applications relating to improvements to the LZW technique,[18] the GIF format may now be used freely."

-Wikipedia
The original comment concerned the COPYRIGHTS on GIF images. Everyone agrees that the patent expired, but a patent is NOT a copyright as I said above (quoted below for your convenience).
joevano wrote:The patent for the TECHNOLOGY expired, copyright is for the creative content. Know the difference, the law does.

Re: New Texture File Extensions!

Posted: Tue Feb 09, 2010 5:15 pm
by hutty
I meant that the technology patent expired, gifs people created ARE still protected by their personal copyrights. As goes with all forms of media.

Although yes SVG would be wonderful. Websites would be using it now to if it wasn't for Internet Explorer and it's [insert derogatory statement here]