Bitmaps, Sprites and Textures: Difference between revisions

Content added Content deleted
m (categories and general cleanup)
m (update links)
Line 36: Line 36:
''Lossless compression'' is compression that always preserves all the data. It's the only compression admissible for contents such as text, executable files, etc. The drawback is that there is absolutely no guarantee the data in question can be made smaller. A prime example of incompressible data is data that was already compressed. That's why if you add some GIF/JPEG/etc. pictures to a ZIP archive, you're likely to see their ''compression rate'' at 0% or 1%. That's not to say it's inappropriate for all pictures, though: Drawings with flat colors and text (think [[MS Paint]] and screenshots of office applications) benefit greatly from lossless compression. Picture formats such as GIF and PNG use lossless compression.
''Lossless compression'' is compression that always preserves all the data. It's the only compression admissible for contents such as text, executable files, etc. The drawback is that there is absolutely no guarantee the data in question can be made smaller. A prime example of incompressible data is data that was already compressed. That's why if you add some GIF/JPEG/etc. pictures to a ZIP archive, you're likely to see their ''compression rate'' at 0% or 1%. That's not to say it's inappropriate for all pictures, though: Drawings with flat colors and text (think [[MS Paint]] and screenshots of office applications) benefit greatly from lossless compression. Picture formats such as GIF and PNG use lossless compression.


''Lossy compression'' is compression that sacrifices some data to compress better. This is acceptable mostly for pictures and sounds (and by extension video) and relies on the eye not "minding" a few minor differences with the original pictures (unless you sacrifice too much data and ruin the picture quality). The main advantage of lossy compression is that it can be set to sacrifice juuuuust as much data as it takes to fit some mold: This is called ''fixed-rate compression''. Time-critical applications such as audio and video absolutely love it, that's how you get audio/video data at ''X kilobits per seconds'' (meaning X/8 kilobytes). Video game graphics hardware is fond of that too: e. g., the [[Nintendo Gamecube]]'s graphics processor natively supports [[wikipedia:S3 Texture Compression|S3 Texture Compression]]. However, it's inappropriate for pictures cited above: the ''compression artefacts'' engendered by the data loss will [[media:CompressionArtefacts_7464.jpg|"pollute" the flat colors and blur the text]]. Picture formats such as JPEG use lossy compression.
''Lossy compression'' is compression that sacrifices some data to compress better. This is acceptable mostly for pictures and sounds (and by extension video) and relies on the eye not "minding" a few minor differences with the original pictures (unless you sacrifice too much data and ruin the picture quality). The main advantage of lossy compression is that it can be set to sacrifice juuuuust as much data as it takes to fit some mold: This is called ''fixed-rate compression''. Time-critical applications such as audio and video absolutely love it, that's how you get audio/video data at ''X kilobits per seconds'' (meaning X/8 kilobytes). Video game graphics hardware is fond of that too: e. g., the [[Nintendo GameCube]]'s graphics processor natively supports [[wikipedia:S3 Texture Compression|S3 Texture Compression]]. However, it's inappropriate for pictures cited above: the ''compression artefacts'' engendered by the data loss will [[media:CompressionArtefacts_7464.jpg|"pollute" the flat colors and blur the text]]. Picture formats such as JPEG use lossy compression.


== [[Sprites Textures And Transparency]] ==
== [[Sprites Textures And Transparency]] ==