textmode.js / export / ImageExportOptions
Type Alias: ImageExportOptions
ts
type ImageExportOptions = object;
Options for exporting the textmode content to image format.
Properties
backgroundColor?
ts
optional backgroundColor: string;
Background color for formats that don't support transparency ('jpg'
).
Format: CSS color string or 'transparent'
for 'png'
/'webp'
.
Default is 'black'
.
filename?
ts
optional filename: string;
The filename to save the image file as (without extension).
If not provided, a default filename is used.
format?
ts
optional format: ImageFormat;
The image format to export ('png'
, 'jpg'
, or 'webp'
).
Default is 'png'
.
quality?
ts
optional quality: number;
Image quality for lossy formats ('jpg'
, 'webp'
).
Range: 0.0
to 1.0
, where 1.0
is highest quality.
Default is 1.0
. Ignored for 'png'
format.
scale?
ts
optional scale: number;
Scale factor for the output image.
1.0
= original size, 2.0
= double size, 0.5
= half size.
Default is 1.0
.