get_png_info: Get information about a PNG file

View source: R/extract-png-info.R

get_png_infoR Documentation

Get information about a PNG file

Description

Get information about a PNG file

Usage

get_png_info(src)

Arguments

src

PNG filename or raw vector containing PNG data

Value

Name list of information about the PNG image:

width,height

Dimensions of PNG

bit_depth

Bit depth. 8 or 16 bits

color_type,color_desc

color type and its description

compression_method

Compression setting

filter_method,filter_desc

Filter method and description

interlace_method,interlace_desc

Interlace method and description

Examples

# Create a small grayscale PNG image and fetch its PNG info
mat <- matrix(c(0L, 255L), 3, 4)
png_data <- write_png(mat)
get_png_info(png_data)


fastpng documentation built on April 3, 2025, 10:01 p.m.