Building GIMP for Windows

The main GIMP building instructions are at Building GIMP. This page is for Windows-specific additions.

Supported Windows API

The supported versions of Windows are noted in the devel-docs/os-support.txt file of the GIMP source you cloned or downloaded.

GIMP project is favoring backward compatibility as a general rule and we really don’t like deprecating hardware (unfortunately often associated to OS version, sometimes for no good reasons, sometimes on purpose by vendors) when it is just a few years old. Nevertheless we may have to bump our Windows requirement when it becomes too hard to maintain both old and new APIs.

Building GIMP natively under Windows using MSYS2

MSYS2 is a project that provides basically everything you would need (package manager, compiler…) to build Windows software.

Running, from GIMP source, build\windows\1_build-deps-msys2.ps1 then build\windows\2_build-gimp-msys2.ps1 might be all there is to do. To better understand the compilation flow, you may read below.

Install the dependencies for GIMP

  1. First, if you don’t have MSYS2 installed, simply run in PowerShell:
winget install MSYS2.MSYS2
  1. To be able to easily use MSYS2 packages, you need to add it to PATH:
$MSYS_ROOT = $(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall -Recurse | ForEach-Object { Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue } | Where-Object { $_.PSObject.Properties.Value -like "*The MSYS2 Developers*" } | ForEach-Object { return "$($_.InstallLocation)" }) -replace '\\','/'

$MSYSTEM_PREFIX = if ((Get-WmiObject Win32_ComputerSystem).SystemType -like 'ARM64*') { 'clangarm64' } else { 'clang64' }

$env:Path = "$MSYS_ROOT/$MSYSTEM_PREFIX/bin;$MSYS_ROOT/usr/bin;" + $env:Path
  1. Update the system:
pacman -Syyuu
  1. Dependencies are installed with the following command:
pacman --noconfirm -S --needed (Get-Content build/windows/all-deps-uni.txt).Replace('${MINGW_PACKAGE_PREFIX}',$(if ($MINGW_PACKAGE_PREFIX) { "$MINGW_PACKAGE_PREFIX" } elseif ($MSYSTEM_PREFIX -eq 'clangarm64') { 'mingw-w64-clang-aarch64' } else { 'mingw-w64-clang-x86_64' })).Replace(' \','')

This step will download a ton of packages, and may take a while.

Prepare for building

On Windows shell, environment variables are defined this way:

#https://gitlab.gnome.org/GNOME/gimp/-/issues/12284
$GIMP_PREFIX = "${HOME}\_install".Replace('\', '/')

# Used to detect the build dependencies
$env:PKG_CONFIG_PATH = "$GIMP_PREFIX/lib/pkgconfig;$MSYS_ROOT/$MSYSTEM_PREFIX/lib/pkgconfig;$MSYS_ROOT/$MSYSTEM_PREFIX/share/pkgconfig"
# Used to find the glib-introspection dependencies
$env:XDG_DATA_DIRS = "$GIMP_PREFIX/share;$MSYS_ROOT/$MSYSTEM_PREFIX/share"

# Used to find programs/tools during build and at runtime
$env:Path = "$GIMP_PREFIX/bin;" + $env:Path
# Used to find introspection files
$env:GI_TYPELIB_PATH = "$GIMP_PREFIX/lib/girepository-1.0;$MSYS_ROOT/$MSYSTEM_PREFIX/lib/girepository-1.0"

Building the software

You can now just follow the instruction on the main page Building GIMP. Just be careful that, since you are using two separate prefixes ($MSYSTEM_PREFIX and $GIMP_PREFIX), the option of relocatability should be disabled at meson setup: -Drelocatable-bundle=no

Once installed, you can always run gimp* using a .ps1 profile.

Building GIMP using Microsoft tools

Microsoft Visual Studio comes with its own C compiler know as MSVC. Most of GIMP development is done with Clang or GCC compilers (provided by MSYS2).

🚧 GIMP do not build on MSVC. If you wish to contribute fixes to make GIMP build with Microsoft VS, then maintain the build so that it continues working, you are welcome to contribute.

Packaging third-party GIMP plug-ins for Windows

Users on the Windows and macOS platforms expect software to be packaged in a self-installing file. Even though GIMP plug-ins are relatively easy to install, you might want to package them using an installer such as Inno Setup for the traditional version, or Windows SDK for the Store version.