to_data_url method

to_data_url

returns a data URI containing a representation of the image in the format specified by the type parameter (defaults to PNG). The returned image is in a resolution of 96 dpi.

Returns

A DOMString containing the requested data URI.

def to_data_url(self):
    ...

to_data_url

returns a data URI containing a representation of the image in the format specified by the type parameter (defaults to PNG). The returned image is in a resolution of 96 dpi.

Returns

A DOMString containing the requested data URI.

def to_data_url(self, type):
    ...
ParameterTypeDescription
typestrA string indicating the image format. The default format type is image/png.

to_data_url

returns a data URI containing a representation of the image in the format specified by the type parameter (defaults to PNG). The returned image is in a resolution of 96 dpi.

Returns

A DOMString containing the requested data URI.

def to_data_url(self, type, encoder_options):
    ...
ParameterTypeDescription
typestrA string indicating the image format. The default format type is image/png.
encoder_optionsfloatA Number between 0 and 1 indicating image quality if the requested type is image/jpeg or image/webp.

See Also