Main Content

images.blocked.PNGBlocks class

Package: images.blocked

Store each block as PNG file in folder


The images.blocked.PNGBlocks class is an adapter for use with blocked images. Use this adapter to store results on disk in PNG format.

Use this adapter to save an image in a folder with individual PNG files per block. PNG format offers lossless compression. The adapter stores the Image in a folder which contains a MAT-file with information about the image (including image size, blocksize, type). This top-level folder has one subfolder per resolution level (L1, L2..LN). These subfolders contain PNG format files for each block.

Data Types

M-by-N: uint8 or uint16; M-by-N-by-3: uint8 or uint16

Multiresolution levelsYes
Use parallel processingYes
Resume processingYes

The images.blocked.PNGBlocks class is a handle class.

Class Attributes


For information on class attributes, see Class Attributes.




adapter = images.blocked.PNGBlocks() creates an instance of an images.blocked.PNGBlocks adapter for use with blockedImage functions.


collapse all

Create a blocked image.

bim = blockedImage('tumor_091R.tif');

Write image data to files. Specify the images.blocked.PNGBlocks adapter.

wa = images.blocked.PNGBlocks();
write(bim, "dirOfPNGs", "Adapter", wa);

Create a blocked image from the folder of images. The blockedImage object automatically picks the appropriate adapter.

bpng = blockedImage("dirOfPNGs");
  PNGBlocks with properties:

    BlockFormat: "png"
Introduced in R2021a