Skip to main content
Version: main

tinct extract

Extract colours from a source without generating output configurations.

Synopsis

tinct extract -i <input-plugin> [flags]

Description

The extract command extracts a colour palette without generating any configuration files. Use it to:

  • Preview colour extraction results
  • Export palettes to JSON for external use
  • Test input plugin configurations
  • Debug colour extraction issues

Required flags

FlagDescription
-i, --inputInput plugin to use

Optional flags

FlagDefaultDescription
-c, --image.colours16Number of colours the image plugin extracts (1–256)
-p, --image.pathPath, directory, or URL for the image plugin
--count32Number of colours in the resulting palette
-o, --outputOutput file path (default: stdout)
-f, --formatpaletteOutput format: palette, hex, rgb, json, categorised
--colourColour override as role=hex, repeatable
--previewfalseShow visual preview
--backendkmeansExtraction algorithm
--plugin-argsArguments for an external plugin, as <plugin>=<json>

Each input plugin contributes its own --<plugin>.<flag> options — --image.* for the built-in image plugin, and for installed external plugins whatever their --plugin-info declares. Run tinct extract --help to see the set available on your machine.

Output formats

palette (default)

Human-readable list with role assignments:

Theme type: dark

background: #1e1e2e
foreground: #cdd6f4
accent1: #89b4fa
accent2: #f5c2e7
...

hex

Simple list of hex colours:

#1e1e2e
#cdd6f4
#89b4fa
#f5c2e7

json

Full JSON with all metadata:

{
"colours": {
"background": {
"hex": "#1e1e2e",
"rgb": {"r": 30, "g": 30, "b": 46},
"rgba": {"r": 30, "g": 30, "b": 46, "a": 255}
}
},
"theme_type": "dark"
}

Examples

Basic extraction

# Extract and display palette
tinct extract -i image -p ~/wallpaper.jpg

# Extract 8 colours
tinct extract -i image -p ~/wallpaper.jpg -c 8

Save to file

# Save as JSON
tinct extract -i image -p ~/wallpaper.jpg -o palette.json --format json

# Save hex list
tinct extract -i image -p ~/wallpaper.jpg -o colors.txt --format hex

Visual preview

# Show coloured preview in terminal
tinct extract -i image -p ~/wallpaper.jpg --preview

From different sources

# From URL
tinct extract -i image -p "https://example.com/wallpaper.jpg"

# From remote JSON
tinct extract -i remote-json \
--remote-json.url "https://github.com/catppuccin/palette/raw/main/palette.json" \
--remote-json.query "colors.mocha"

From an external input plugin

Installed external plugins take their arguments the same way here as on generate — either as dedicated flags or as JSON:

# Dedicated flags, registered from the plugin's own --plugin-info
tinct extract -i random --random.seed 12345 --random.count 8

# The equivalent JSON form
tinct extract -i random --plugin-args random='{"seed":12345,"count":8}'

Use cases

Pipeline integration

# Get colours for a script
COLORS=$(tinct extract -i image -p ~/wallpaper.jpg --format hex)

Comparison

# Compare extraction with different colour counts
tinct extract -i image -p ~/wallpaper.jpg -c 8 --preview
tinct extract -i image -p ~/wallpaper.jpg -c 16 --preview

External tool input

# Export for use with other tools
tinct extract -i image -p ~/wallpaper.jpg -o palette.json --format json

See also