Repository navigation
Support HSV and step segments when reading GIMP gradients - #10669
Merged
radarhere merged 2 commits intoDec 1, 2026
Merged
Conversation
GimpGradientFile raised OSError for segments coloured in HSV, which 7 of the 78 gradients included with GIMP use, and IndexError for the step blending function added in GIMP 2.10. Interpolate the hue counter-clockwise or clockwise as GIMP does, and add the step function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
radarhere
force-pushed
the
gimp-gradient-hsv-step
branch
from
December 1, 2026 03:17
9538996 to
da5f4d7
Compare
radarhere
force-pushed
the
gimp-gradient-hsv-step
branch
from
December 1, 2026 03:20
da5f4d7 to
29ebbe9
Compare
Member
|
For future reference, there is a specification at https://developer.gimp.org/core/standards/ggr/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request:
GimpGradientFileraisedOSError: cannot handle HSV colour spacefor gradient segments that blend in HSV. 7 of the 78 gradients that come with GIMP use HSV, including "Full saturation spectrum CCW", "Full saturation spectrum CW" and "Pastel Rainbow", soImagePalette.load()could not read them.gimp_gradient_get_color_at(). Saturation and value change linearly, and the hue goes counter-clockwise (colour type 1) or clockwise (colour type 2). If both ends have the same hue, it goes all the way around, which is how the "Full saturation spectrum" gradients go from red back to red through every hue.pos >= middleand 0 otherwise. It raisedIndexError: list index out of range, and is now inSEGMENTS.The tuples in
GradientFile.gradientnow have the colour type as a seventh item.🤖 Generated with Claude Code