imageformats 7.0.1
Decoders for PNG, TGA, BMP, JPEG and encoders for PNG, TGA, BMP.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
imageformats
- Docs
- Returned image data is 8-bit except PNG can also return 16-bit.
- Image data can be converted to Y, YA, RGB or RGBA.
- There's a @nogc remake: imagefmt
Format | Decoder | Encoder |
---|---|---|
png | 8-bit, 16-bit | 8-bit non-paletted non-interlaced |
tga | 8-bit non-paletted | 8-bit non-paletted |
bmp | 8-bit | 8-bit uncompressed |
jpeg | baseline | nope |
import imageformats;
void main() {
IFImage i0 = read_image("peruna.png");
IFImage i1 = read_image("peruna.png", ColFmt.YA); // convert
IFImage i2 = read_image("peruna.png", ColFmt.RGB);
write_image("peruna.tga", i0.w, i0.h, i0.pixels);
write_image("peruna.tga", i0.w, i0.h, i0.pixels, ColFmt.RGBA);
int w, h, chans;
read_image_info("peruna.png", w, h, chans); // no decoding
// format specific functions
PNG_Header hdr = read_png_header("peruna.png");
IFImage i3 = read_jpeg("porkkana.jpg");
write_tga("porkkana.tga", i3.w, i3.h, i3.pixels);
}
Tipjar: nano_1xeof5x1ukki4awa7fp9gyb3qsymmrr4s3i8o63okzdq3bhsdj56nefm9shs
- 7.0.1 released 5 years ago
- tjhann/imageformats
- BSL-1.0
- Authors:
- Dependencies:
- none
- Versions:
-
7.0.2 2019-Oct-10 7.0.1 2019-Jul-12 7.0.0 2018-Apr-14 6.1.3 2018-Mar-29 6.1.2 2017-Oct-31 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
12 downloads this month
-
53186 downloads total
-
- Score:
- 2.5
- Short URL:
- imageformats.dub.pm