04-21-2025, 05:04 PM
Found this here via Startpage search engine, while working with a 1980's vintage engineering drawing, and I wanted to put a dash-dot-dash dimension line into the image, and... oh boy.
I'm putting this here in the hopes that it will be of some use to anyone else out there using GIMP who's attempting to create a line by stroking a Path, who wants some sort of dashed line. What I originally wanted was a simple-enough dash-dot-dash line, which I could customize to well-enough match the existing lines on the 4000 pixel-width image I'm working with.
Please find the results of my investigations below, with profuse thanks and appreciation to rich2005 for putting me on to the existence of, the purpose of, and the location for, the gimprc file which controls this stuff (and a whole lot more, too). For what it may be worth, I'm running GIMP 3.0 as a appimage in Linux Mint. Find that file in Linux Mint, altering your username of course to suit, here: /home/mxm/.config/GIMP/3.0/gimprc
Note: All quotes in the below text are added by myself, and do not exist in the gimprc file in the area of interest.
There is a line in gimprc which needs attention and it's down near the bottom, under the heading of "(stroke-options" and yes, that prepending "(" is important, as is all the rest of the contents of this file, so please BE CAREFUL, lest you blow the whole place up, ok?
The line in question begins with "(dash-info " and those letters are followed by a very arcane string of numerical digits, and it's those numerical digits that run the show.
What I'm using right now, which renders a pleasing (to me) dash-dot-dash pattern for a line that I've specified as 4 pixes wide looks like this,
(dash-info 5 10 3 0.5 3 2.5)
and following the letters, we have SIX numerical digits, which I will (creatively enough) refer to as First, Second, Third, Fourth, Fifth, and Sixth, going in left to right order, and just to make sure we're all on the same page with that, the First Digit in that string is a "5" and the Sixth Digit in that string is a "2.5".
The First Digit tells the line-stroking part of GIMP that we're going to have a Dash-Dot-Dash pattern here, and if you look close at what I just wrote, you will see that "Dash-Dot-Dash" is a FIVE-part term, with three words separated by two dashes, and this helps me remember what I'm doing, which is why I point it out here.
If that First Digit had been a "7", the string would have included a pair of additional digits, and the sense of things would be that we would now have a Dash-Dot-Dot-Dash line stroke, and again count up the words and dashes and it adds up to 7 so... ok. You can add as many more terms as you might want to. We'll stick with Dash-Dot-Dash with its prepending 5 for now.
Again, First Digit tells it how much dash and dot we're gonna get.
Second Digit is the LENGTH of the First DASH, and this stuff is done as a sort of MULTIPLIER of the Line Thickness, which is specified elsewhere.
Third Digit is the LENGTH of the First SPACE, following that First Dash.
Fourth Digit is the LENGTH of the Second DASH (ok, it's a DOT, but you know what I mean), following the First Space after the First Dash, and if I'd specified it at the same value as the First Dash, then we'd simply have a repeating-dash pattern, instead of Dash-Dot-Dash.
Fifth Digit is the LENGTH of the Second SPACE, following the Second Dash.
And the Sixth and Final Digit is another multiplier, which works on the First Dash, and I've got a feeling if I was to put more numbers in there after it, I'd be multiplying subsequent Spaces and Dashes, but I've been at this all morning, and... not now, ok?
So.
For my Dash-Dot-Dash pattern, the digits for the two SPACES get specified at the SAME VALUE, and that keeps the DOT between the DASHES correctly centered (which of course means that if I wanted to offset things for any reason, I could cause those numbers to be different, and that would cause the dot to be offset in the resulting line-stroke pattern. Additionally we do not need to further specify length/location, because the First Digit, the "5" tells it to start repeating with a new Dash of the same length as the First Dash, and on and on it goes, merrily dashing and dotting away, for the length of whatever Path we decided to Stroke.
And once you've figured this one out, you need never again find yourself at the mercy of that little GUI for Custom Dash Pattern which you get in the Choose Stroke Style dialog box when you tell GIMP you want something a little more involved than just a simple solid line. That little GUI thing is DIFFICULT to use (for me anyway) and knowing that I can specify things NUMERICALLY in the gimprc file is a HUGE improvement for me.
Here's the image in question, where I was experimenting around with this thing, stroking successive Paths, altering the (dash-info parameters as I went along.
I'm putting this here in the hopes that it will be of some use to anyone else out there using GIMP who's attempting to create a line by stroking a Path, who wants some sort of dashed line. What I originally wanted was a simple-enough dash-dot-dash line, which I could customize to well-enough match the existing lines on the 4000 pixel-width image I'm working with.
Please find the results of my investigations below, with profuse thanks and appreciation to rich2005 for putting me on to the existence of, the purpose of, and the location for, the gimprc file which controls this stuff (and a whole lot more, too). For what it may be worth, I'm running GIMP 3.0 as a appimage in Linux Mint. Find that file in Linux Mint, altering your username of course to suit, here: /home/mxm/.config/GIMP/3.0/gimprc
Note: All quotes in the below text are added by myself, and do not exist in the gimprc file in the area of interest.
There is a line in gimprc which needs attention and it's down near the bottom, under the heading of "(stroke-options" and yes, that prepending "(" is important, as is all the rest of the contents of this file, so please BE CAREFUL, lest you blow the whole place up, ok?
The line in question begins with "(dash-info " and those letters are followed by a very arcane string of numerical digits, and it's those numerical digits that run the show.
What I'm using right now, which renders a pleasing (to me) dash-dot-dash pattern for a line that I've specified as 4 pixes wide looks like this,
(dash-info 5 10 3 0.5 3 2.5)
and following the letters, we have SIX numerical digits, which I will (creatively enough) refer to as First, Second, Third, Fourth, Fifth, and Sixth, going in left to right order, and just to make sure we're all on the same page with that, the First Digit in that string is a "5" and the Sixth Digit in that string is a "2.5".
The First Digit tells the line-stroking part of GIMP that we're going to have a Dash-Dot-Dash pattern here, and if you look close at what I just wrote, you will see that "Dash-Dot-Dash" is a FIVE-part term, with three words separated by two dashes, and this helps me remember what I'm doing, which is why I point it out here.
If that First Digit had been a "7", the string would have included a pair of additional digits, and the sense of things would be that we would now have a Dash-Dot-Dot-Dash line stroke, and again count up the words and dashes and it adds up to 7 so... ok. You can add as many more terms as you might want to. We'll stick with Dash-Dot-Dash with its prepending 5 for now.
Again, First Digit tells it how much dash and dot we're gonna get.
Second Digit is the LENGTH of the First DASH, and this stuff is done as a sort of MULTIPLIER of the Line Thickness, which is specified elsewhere.
Third Digit is the LENGTH of the First SPACE, following that First Dash.
Fourth Digit is the LENGTH of the Second DASH (ok, it's a DOT, but you know what I mean), following the First Space after the First Dash, and if I'd specified it at the same value as the First Dash, then we'd simply have a repeating-dash pattern, instead of Dash-Dot-Dash.
Fifth Digit is the LENGTH of the Second SPACE, following the Second Dash.
And the Sixth and Final Digit is another multiplier, which works on the First Dash, and I've got a feeling if I was to put more numbers in there after it, I'd be multiplying subsequent Spaces and Dashes, but I've been at this all morning, and... not now, ok?
So.
For my Dash-Dot-Dash pattern, the digits for the two SPACES get specified at the SAME VALUE, and that keeps the DOT between the DASHES correctly centered (which of course means that if I wanted to offset things for any reason, I could cause those numbers to be different, and that would cause the dot to be offset in the resulting line-stroke pattern. Additionally we do not need to further specify length/location, because the First Digit, the "5" tells it to start repeating with a new Dash of the same length as the First Dash, and on and on it goes, merrily dashing and dotting away, for the length of whatever Path we decided to Stroke.
And once you've figured this one out, you need never again find yourself at the mercy of that little GUI for Custom Dash Pattern which you get in the Choose Stroke Style dialog box when you tell GIMP you want something a little more involved than just a simple solid line. That little GUI thing is DIFFICULT to use (for me anyway) and knowing that I can specify things NUMERICALLY in the gimprc file is a HUGE improvement for me.
Here's the image in question, where I was experimenting around with this thing, stroking successive Paths, altering the (dash-info parameters as I went along.
![[Image: Path%20Stroke%20Parameters%20Decoded%20O...0label.jpg]](https://www.16streets.com/39-B/Reference%20Images/Path%20Stroke%20Parameters%20Decoded%20OAA%20Latchback%20Work%20Platform%20from%2079K24048%20S-215%20flattened%20label.jpg)