Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If you take only the leading part of jpg or jp2 or webp file, you'll get image with missing parts or decoding will fails entirely.

When I experimented with LuraWave special proprietary lwf, file truncation only decreased quality uniformly (as if the picture were encoded with lower quality settings initially)

What other picture formats supports this, i.e. allows graceful degradation when tail of file is missing?

The main idea is to store images with high quality and later be able to quickly reduce quality (and file size) bit by bit without re-encoding.

share|improve this question

An interlaced PNG supports this internally. I don't know how well most imageviewers would handle pure truncation (i.e., missing the IEND chuck which marks the end of the file), but when saved as interlaced, the lines of the image are saved in such an order that a blurry version of the image can be loaded quickly, and then the image is slowly refined until the entire image is loaded. This is very useful for loading images over slow connections (Dial-Up, 3G), where you want the user to be able to see something quickly, instead of making them wait to get a full glimpse of the image.

You can see this by finding a large image (wallpaper?) and saving it as an interlaced .png. Upload the file to a slow webhost, or otherwise use a tool like Fiddler to simulate a slow network connection, and then try to load the image in a browser.

You'll first get something like every 8th line of the image, and then you'll get every 4th, and then every other, and then you'll get all the remaining lines of the image.

share|improve this answer
Does support efficient compression when heavily interlaced mode (not just coarse and fine, but many many layers to)? The main idea is to store images with high quality and later reduce the quality bit by bit if images are not very needed. – Vi. Aug 23 '12 at 22:32
up vote 0 down vote accepted

Not exactly the crude file truncation, but something similar can be done with djvu's c44 images:

$ c44 q.ppm q.djvu -bpp 0.05,0.1,0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50,0.55,0.60,0.65,0.70
$ djvuextract q.djvu BG44=data.iff
BG44=data.iff --> "data.iff" (54286 bytes)
$ djvudump q.djvu  | grep INFO
INFO [10]         DjVu 1023x599, v24, 100 dpi, gamma=2.2
$ djvumake 5.djvu  INFO=1023,599,100 BG44=data.iff:5
$ djvumake 10.djvu INFO=1023,599,100 BG44=data.iff:10
$ djvumake 1.djvu  INFO=1023,599,100 BG44=data.iff:1
$ ls -s --block-size=1 1.djvu 5.djvu 10.djvu 
45056 10.djvu   8192 1.djvu  24576 5.djvu
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .