32

"How (hardware) texture compression works" is a large topic. Hopefully I can provide some insights without duplicating the content of Nathan's answer. Requirements Texture compression typically differs from 'standard' image compression techniques e.g. JPEG/PNG in four main ways, as outlined in Beers et al's Rendering from Compressed Textures: Decoding ...


27

As Simon's comment alluded to, one major difference between hardware texture compression and other commonly used image compression is that the former does not use entropy coding. Entropy coding is the use of shorter bit-strings to represent commonly-occurring or repeating patterns in the source data—as seen in container formats like ZIP, many common ...


9

JPEG compression involves three main steps: Chroma subsampling. The image is converted from RGB into YCbCr color space, in which the luma or brightness (Y) is stored separately from the chroma or color components, Cb and Cr. The Y component is kept at full resolution, but Cb and Cr are downsampled, typically to half resolution on each axis. This exploits ...


7

The short answer is "no", for reasons covered in Alvy Ray Smith's memo, Gamma Correction. Gamma is not about nonlinearity in human perception, it's about nonlinearity in display devices (and, I suppose, acquisition devices too).


4

One issue is "chroma subsampling". The image data of a JPEG is not stored in packed RGB but YCbCr as 3 seperate planes. The Cr and Cb channels contain colour information and the Y channel is luminance. In JPEG it is common to use a lower resolution Cr/Cb channel, typically at half the resolution of the Y channel, this is know as 422 Chroma subsampling (...


4

Because memory bandwidth is not free. No matter how much RAM you have, it takes less time to read 1024 bytes than it does to read 1024 KB. Compressed textures, relative to 32-bpp, can offer compression ratios of 4:1 or better. That's at least one quarter of the memory bandwidth costs of fetching the texture. If your rendering uses lots of textures, ...


3

After looking into this for a while, I found out a couple of things: You cannot avoid a memcpy: You cannot write directly into texture storage allocated for a compressed texture using only OpenGL API calls. This means that you cannot avoid the call to glCompressedTexImage2D with a bound PBO. That being said, you may be able to use a 16-bit RGBA texture and ...


3

Desktop OpenGL requires implementations to convert pixel data between the internal format of the image and the format you specify in the pixel transfer command. OpenGL ES does not. Indeed, it is so serious about not allowing this that it actually changes the meaning of the parameters to functions like glTexImage*d. In ES, you cannot use sized internal ...


2

GIF animation compressors normally do this automatically, using transparency in a given frame to avoid storing what has not changed from the previous frame. The reason it's not working in your case is that your input is bad. The flat part of the parchment is not really static. It is moving slowly upwards, at a rate of about 1 pixel every 20 frames. Fix your ...


2

Notch's engine most likely works using volume raymarching in a volume field. This means that you shoot rays that move a certain distance and check whether they are inside and object or not. Once they are, they return the position of the colission and some other data. You can either advance rays by a set amount per step until you hit something or refine the ...


2

PNG format is lossless format where for compression the image is first "filtered" and this filtered image is then passed to DEFLATE lossless compression algorithm. The purpose of filtering stage is to make the image more compressible by DEFLATE and current method uses delta-compression from previously decoded pixels. So if your plan is to pre-process the ...


2

According to Wikipedia (insert standard disclaimer RE accuracy): JPEG does not define which color encoding is to be used for images. JFIF defines the color model to be used: either Y for greyscale, or YCbCr as defined by CCIR 601. YCbCr is a non-linear format. As I mentioned earlier, "Video Demystified" states: "YCbCr is the color space originally ...


2

The "modern equivalent" of animated GIFs is... MPEG. Or really, any decent movie compression format. These techniques are designed to spend fewer bits on static areas and more bits on moving ones. And better still, they're designed to be dynamic, allowing motion in any are at any time, rather than only in fixed areas. So just make a short, looping ...


2

Don't store the rasterized image instead store the drawn strokes as vector graphics. Those should compress pretty well. Adding timestamps to each stroke should then be very simple. You can caching the rasterized image during execution to avoid needing to rerender every stroke every frame.


1

First, here is a link to a related topic of the graphic design stack exchange site. Even though the discussion was more focussed around effects on an image with large homogeneous color areas, here are some quotes I think that are relevant for your case: JPEGs are best suited for continuous tone images like photographs or natural artwork; not so well on ...


1

First off, it's worth noting that not all artefacts are regions of the same colour. Artefacts just means structured errors introduced by the compression, as opposed to noise or blurring. JPEG artefacts include flattened colours as you mention, but also edges introduced at block boundaries, and "ringing" around sharp edges in the image. There are two popular ...


Only top voted, non community-wiki answers of a minimum length are eligible