Learn R Programming

fastpng (version 0.1.7)

get_png_info: Get information about a PNG file

Description

Get information about a PNG file

Usage

get_png_info(src)

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

Arguments

src

PNG filename or raw vector containing PNG data

Examples

Run this code
# 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)

Run the code above in your browser using DataLab