How to convert an image to the Nord palette with ImageGoNord

Convert Images To Nordic Colour Palette In The Command Line

ImageGoNord converts an RGB image into the Nord palette through its current Python package. Install image-go-nord, then use a small script that saves a separate output file.

Install ImageGoNord in a virtual environment

Create a folder for the conversion and install the package into a virtual environment, which keeps ImageGoNord and its image libraries away from the Python packages your distribution uses.

mkdir imagegonord-work
cd imagegonord-work
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade image-go-nord

The package installs the ImageGoNord library. The conversion script uses that library API instead of expecting a cli.py file.

Create the conversion script

Save the following file as convert_to_nord.py. It accepts an input image and output filename, checks that the source exists, loads the default Nord palette, and writes the transformed image without replacing your original.

from pathlib import Path
import sys

from ImageGoNord import GoNord


def main():
    if len(sys.argv) != 3:
        raise SystemExit("Usage: python convert_to_nord.py input.png output.png")

    source = Path(sys.argv[1])
    destination = Path(sys.argv[2])
    if not source.is_file():
        raise SystemExit(f"Input file does not exist: {source}")

    converter = GoNord()
    image = converter.open_image(source)
    converted = converter.convert_image(image)
    converter.save_image_to_file(converted, destination)
    print(f"Saved Nord-palette image to {destination}")


if __name__ == "__main__":
    main()

Convert an image to the Nord palette

Place a PNG or another Pillow-supported image in the same directory as the script. Run this command after activating the virtual environment.

source venv/bin/activate && python convert_to_nord.py input.png output.png

The command writes output.png while leaving input.png unchanged, so you can open the new file in your image viewer and decide whether its palette treatment fits your desktop.

Terminal output confirming ImageGoNord saved a Nord-palette image to output.png
ImageGoNord confirms the output filename after conversion.

What ImageGoNord changes

GoNord loads the Polar Night, Snow Storm, Frost, and Aurora color files as its default palette. During conversion, it maps image colors to the closest available palette colors, which keeps the image structure while changing its color treatment.

ImageGoNord can also load a custom palette file through its Python API. Start with the default conversion before changing palette files or enabling the optional model-based conversion, because each change makes the result harder to judge.

Fix common ImageGoNord errors

If Python says that it cannot import ImageGoNord, activate the same virtual environment where you installed image-go-nord. Running python -m pip install image-go-nord after activation installs the package for that interpreter.

If the script reports that the input file does not exist, check the filename and either move the image into the working directory or pass its full path. Keep a different output filename so you can compare the original against the converted image.

Use the output as a wallpaper

Inspect output.png at the size you use on your desktop before applying it. A palette conversion changes color selection, so a photo with fine color differences can need a different source image or a custom palette.

Sources

ImageGoNord on PyPI documents the current package distribution. The ImageGoNord-pip repository documents the library and its palette conversion scope.