public final class RagMipMaps extends Object
RawMipMaps
, but the alpha channel is compressed with GZIP.
Uses level 4 compression which is the best balance between speed and
compression for the typical alpha mask:
-rw-r--r-- 1 albert albert 5032222 2012-02-21 10:35 mask.tif
-rw-r--r-- 1 albert albert 34688 2012-02-24 06:08 mask.tif.1.gz
-rw-r--r-- 1 albert albert 34157 2012-02-24 06:07 mask.tif.2.gz
-rw-r--r-- 1 albert albert 34234 2012-02-24 06:07 mask.tif.3.gz
-rw-r--r-- 1 albert albert 15440 2012-02-24 06:07 mask.tif.4.gz
-rw-r--r-- 1 albert albert 15872 2012-02-24 06:07 mask.tif.5.gz
-rw-r--r-- 1 albert albert 16034 2012-02-24 06:07 mask.tif.6.gz
-rw-r--r-- 1 albert albert 16014 2012-02-24 06:07 mask.tif.7.gz
-rw-r--r-- 1 albert albert 11320 2012-02-24 06:07 mask.tif.8.gz
-rw-r--r-- 1 albert albert 9795 2012-02-24 06:06 mask.tif.9.gz
The test above was done with a mask (mask.tif) which encodes for the outside of
a coordinate transformed image. The program used was e.g. gzip -4 -c mask.tif > mask.tif.4.gz
.Modifier and Type | Field and Description |
---|---|
static byte |
GREY
These are both the 4 supported types and the number of channels that each type has.
|
static byte |
GREY_ALPHA
These are both the 4 supported types and the number of channels that each type has.
|
static int |
HEADER_SIZE
Two 4-byte ints, for width and height, and one byte for the type.
|
static byte |
RGB
These are both the 4 supported types and the number of channels that each type has.
|
static byte |
RGBA
These are both the 4 supported types and the number of channels that each type has.
|
Constructor and Description |
---|
RagMipMaps() |
Modifier and Type | Method and Description |
---|---|
static ImageBytes |
load(String path) |
static BufferedImage |
read(String path) |
static boolean |
save(String path,
byte[][] b,
int width,
int height) |
public static final byte GREY
public static final byte GREY_ALPHA
public static final byte RGB
public static final byte RGBA
public static final int HEADER_SIZE
public static final boolean save(String path, byte[][] b, int width, int height)
public static final ImageBytes load(String path)
public static final BufferedImage read(String path)
Copyright © 2015–2021 Fiji. All rights reserved.