Android-Webp profile
Purpose
The profile is designed to import WEBP resources as an android drawable resources. Different densities (ldpi, mdpi, hdpi, xhdpi, etc) and light/dark options (night) are supported.
Default loading process
The asset import process consists of the following stages:
- Fetch Figma remote: REST API reference
- Locate the node ID by the specified name
- Request SVG export from Figma using the node ID: REST API reference
- Includes dark theme variants when configured (night)
- Download SVG assets
- Render SVG images into PNG for all requested densities
- Convert rendered PNGs to WEBP format (using
libwebp
) - Organize outputs in standard Android resource structure:
drawable-{density}/
drawable-night-{density}
Legacy loading process (legacy_loader = true
)
The asset import process consists of the following stages:
- Fetch Figma remote: REST API reference
- Locate the node ID by the specified name
- Request PNG export from Figma using the node ID: REST API reference
- Batch request PNG exports for all densities
- Includes dark theme variants when configured (night)
- Download all PNG assets
- Convert to WEBP format (using
libwebp
) - Organize outputs in standard Android resource structure:
drawable-{density}/
drawable-night-{density}
Complete Configuration in .figtree.toml
[profiles.android-webp]
# ID from the [remotes] section.
# Uses the default remote if unspecified, but can reference any configured remote
remote = "some_remote_id"
# Root Android resources directory
# (parent of drawable-* folders)
android_res_dir = "src/main/res"
# Output quality for WEBP conversion (0-100)
# Defaults to 100 (lossless) - recommended value
quality = 100
# Density configurations
scales = ["mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"]
# Dark theme configuration
# Naming pattern for dark theme variants
# {base} is replaced with base asset name
# Leave unspecified to disable dark theme support
night = "{base} / Dark"
# If true, the legacy resource loading method will be used.
# The new approach downloads the SVG source and renders the raster image locally.
# In most cases, this significantly speeds up the import process.
# This may not suit all use cases, so the feature can be disabled.
legacy_loader = false