Skip to content

Fast encoder/decoder for the lossless DTM 16 bit image format

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

kurtkuehnert/dtm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DTM Image Format

Fast encoder/decoder for the DTM image format.

The DTM image format is a 16-bit lossless image format supporting one to four channels. Its purpose is to serve as a (10x - 20x) faster png alternative with comparable compression.

This format was developed to compress large terrain heightmaps also known as digital terrain models, hence the name.

Example

use dtm::DTM;

fn main() {
    let descriptor1 = DTM {
        pixel_size: 2,
        channel_count: 1,
        width: 16,
        height: 16,
    };
    let data1 = vec![0u16; descriptor1.image_pixel_count()];

    descriptor1.encode_file("image.dtm", &data1).unwrap();
    let (descriptor2, data2) = DTM::decode_file("image.dtm").unwrap();

    assert_eq!(descriptor1, descriptor2);
    assert_eq!(data1, data2);
}

Note

This format is in now way stable or formally specified. I might extend it to support 8 and 32 bit images as well.

License

DTM Image Format is dual-licensed under either

at your option.

About

Fast encoder/decoder for the lossless DTM 16 bit image format

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages