AvifSupport.avif_decode — Methodavif_decode(filename::Union{AbstractString,IO}; kwargs...) -> Vector{Matrix{Colorant}}
avif_decode(data::Vector{UInt8}; kwargs...) -> Vector{Matrix{Colorant}}Decode the AVIF image as an array of colorant matrices. The source data can be either a filename, an IO , or an in-memory byte sequence.The output is an array of matrices of type Colorant.
parameters
transpose::Bool: whether we need to permute the image's width and height dimension before encoding. The default value isfalse.Custom Decoding parameters LibAvif has a large number of decoder parameters that determine how the image is decoded. Most applications don't need or want to know about all these parameters. For more detailed information and explaination, please refer to the documents in [1]. Unsupported custom parameters might cause Julia segmentation fault.
The following are the default parameters used in this implementation for decoding :
- codecChoice = libaom
- maxThreads = Threads.nthreads()
- speed = 4
References
AvifSupport.avif_encode — Methodavif_encode(image::AbstractMatrix{TColor}) -> Vector{UInt8}
avif_encode(image_arr::AbstractArray) -> Vector{UInt8}Encode 2D image imgor an array of 2D images image_arr as an AVIF byte sequence . The return value is a vector of bytes.
Parameters for avif_encode(image::AbstractMatrix{TColor})
transpose::Bool: whether we need to permute the image's width and height dimension
before encoding. The default value is false.
quality::Int: The quality value is between 0..100 . The default value is10.transpose::Bool: whether we need to permute the image's width and height dimension
before encoding. The default value is
false.mode::String: Determines the type of encoding of the input image .For 2D images , the encoding mode is one of two values : "one_frame" which is the default and "grid".Parameters for avifencode(imagearr::AbstractArray)
transpose::Bool: whether we need to permute the image's width and height dimension
before encoding. The default value is
false.quality::Int: The quality value is between 0..100 . The
default value is
10.mode::String: Determines the type of encoding of the input .For arrays of 2D images ,
the encoding mode is one of three values :
"seq"(for sequential) which is the default ,"grid"or"layered".grid_cols::Int: - ONLY RELEVANT TO GRID ENCODING - Determines the number of columns of the resulting image .
The grid_cols value depends on the length of the input vector. The default value is
1.grid_rows::Int: - ONLY RELEVANT TO GRID ENCODING - Determines the number of rows of the resulting image .
The grid_rows value depends on the length of the input vector. The default value is
1.timescale::Int: - ONLY RELEVANT TO LAYERED ENCODING -
default value is
1.
LibAvif has a large number of encoder parameters that determine how the image is encoded. Most applications don't need or want to know about all these parameters. For more detailed information and explaination, please refer to the document [1]. Unsupported custom parameters might cause Julia segmentation fault.
The following are the default parameters used in this implementation for decoding :
- codecChoice = libaom
- maxThreads = Threads.nthreads()
- speed = 4
grid_cols * grid_rows = length(image_arr)References
AvifSupport.is_valid_avif — Methodis_valid_avif(file_path::AbstractString)Returns False if file_path is not a valid avif/avis file .
AvifSupport.version_info — Functionversion_info(io=stdout)Print information about the package the libavif in use.
AvifSupport.write_avif — Methodwrite_avif(dest_file::AbstractString, image::AbstractMatrix{<:Colorant}; kwargs...) -> Integer
write_avif(dest_file::AbstractString, image_arr::TVector; kwargs...) -> IntegerUtility function that encodes a matrix of Colorant or an array of matrices of Colorant into a dest_file Avif image.