Given the recent trend of Facebook avatars incorporating the rainbow flag, to reflect the recent Supreme Court of The United States' ruling that gay marriage is legal nationwide (in the US), I was trying to add such a gradient to GIMP (version 2.8).

The gradient:

enter image description here

was found at this page: https://openclipart.org/detail/220824/original-gay-pride-flag and is an SVG file, containing the following:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="600" height="400">
    <rect width="600" height="400" fill="#8e008e"/>
    <rect width="600" height="350" fill="#400098"/>
    <rect width="600" height="300" fill="#00c0c0"/>
    <rect width="600" height="250" fill="#008e00"/>
    <rect width="600" height="200" fill="#ff0"/>
    <rect width="600" height="150" fill="#ff8e00"/>
    <rect width="600" height="100" fill="#f00"/>
    <rect width="600" height="50" fill="#ff69b4"/>

I placed this in the following directories, first:

C:\Program Files\GIMP 2\share\gimp\2.0\gradients

And, secondly, in:


I've refreshed the gradients (within the GIMP program), and closed – then reopened – the program.

Refreshing the gradients has produced the following error message in a pop-up alert-type window:

Failed to load data:

No linear gradients found in 'C:\Program Files\GIMP 2\share\gimp\2.0\gradients\Gay_flag_8.svg'


Failed to load data:

No linear gradients found in 'C:\Users\David.gimp-2.8\gradients\Gay_flag_8.svg'

I'm – clearly – missing something, but I have no idea what I'm doing wrong, or not doing at all.

Following advice, from gronostaj's answer, I've opened the SVG file in GIMP and, when offered the import options of:

Import paths, and Merge imported paths

I've checked both, and then saved the file – as a .xcf file – and then exported as a .pat file. This exported file was then placed in the appropriate directory:


With the file-name of RainbowFlag.pat.

I then tried to refresh the available gradients, which produces this error:

GIMP Message

Failed to load data:

Fatal parse error in gradient file 'C:\Users\David.gimp-2.8\gradients\RainbowFlag.pat': Not a GIMP gradient file.

tl;dr: how do I add a new gradient, of SVG type, to GIMP 2.8?

1 Answer 1


What you created there is not an SVG "gradient" - it is rather an SVG image with the rainbow colors.

SVG Gradents use the <lineargradient>...</...> XML element - there is a clear example of how to create one at: http://www.w3schools.com/svg/svg_grad_linear.asp -- You can either convert your handcoded pattern to a SVG properly using <lineargradient> and <stop> elements - or save a GIMP gradient file and edit that instead (since it is also a text based format). Just one more thing: beware that since you want hard color edges, you need two stops at each transition - for example,at the point 0.125, you need first a pink stop, to mark the end of pink, and follow it by a red stop, to mark the beginning of red. (And that is why I'd say you are at least on the right track by trying to hand-edit the text definition of the gradient - this would be somewhat hard to come buy by using the U.I.)

  • While I was, definitely, beginning to realise that what I had was not an 'authentic' gradient - given the increasing complexity - I hadn't realised just how far from such it was. Thank you for your answer, I'll look into this presently. I would, however, ask that you improve your answer and don't rely on users following links to external sites. I know I have a low reputation here, but this advice is based on my experiences over at Stack Overflow, where I'm a little more familiar with the 'rules' (which I imagine are similar to those here). Jun 29, 2015 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.