Smoothing a line?
Moderator: Kathy_9
-
terrypin
- Posts: 492
- Joined: Tue Jun 29, 2010 9:51 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Asus Z170 Pro 4
- processor: Intel Core i7 6700K 4.0GHz
- ram: 32 GB
- Video Card: None - uses built-in graphics
- sound_card: HD onboard sound card
- Hard_Drive_Capacity: 4.256 TB
- Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
- Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
- Location: East Grinstead UK
Smoothing a line?
What would be the easiest way to 'smooth' the jagged line of this elevation profile please? IOW, to thicken the line so that its tiny variations cannot be seen?
https://www.dropbox.com/s/3coaup9ww5e5k ... 1.jpg?dl=0
If it helps, I don't mind losing the dotted lines although I would prefer to keep the small text if possible.
This is PSP 8 but I could try to adapt methods from less ancient versions.
https://www.dropbox.com/s/3coaup9ww5e5k ... 1.jpg?dl=0
If it helps, I don't mind losing the dotted lines although I would prefer to keep the small text if possible.
This is PSP 8 but I could try to adapt methods from less ancient versions.
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
-
JoeB
- Posts: 2778
- Joined: Fri Mar 28, 2008 10:04 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: LENOVO 4524PE4 ThinkCentre M91p
- processor: 3.10 gigahertz Intel Quad Core i5-2400
- ram: 8 GB
- Hard_Drive_Capacity: 4.6 TB
- Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
- Location: Canada
Re: Smoothing a line?
I suspect that the fastest and easiest way is to simply trace over the elevation line with a small, round, relatively soft paintbrush.
Regards,
JoeB
Using PSP 2019 64bit
JoeB
Using PSP 2019 64bit
-
Jean-Luc
- Advisor
- Posts: 2177
- Joined: Sat Oct 22, 2011 10:50 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: ASUS Computer N751J
- processor: Intel i7_4710 HQ 2_50GHz
- ram: 16GB
- Video Card: NVIDIA GeForce GTX 850M
- sound_card: NVIDIA High Definition Audio
- Hard_Drive_Capacity: 2 Tb
- Monitor/Display Make & Model: NVIDIA GeForce GTX 850M
- Corel programs: PSP X7, X9, 2018 to 2023
- Location: Belgium (French speaking)
- Contact:
Re: Smoothing a line?
Freehand selection
Smart Edge
Replace
Feather 1
Smoothing 10
Anti-alias checked
(you may adapt the values)
This will permit to trace the line with less jaggies. (you need to trace over the jagged line)
Now, the finish touch:
Selections / Modify / Select selection borders
-> Both sides
Anti-alias checked
Border width : 2
Smart Edge
Replace
Feather 1
Smoothing 10
Anti-alias checked
(you may adapt the values)
This will permit to trace the line with less jaggies. (you need to trace over the jagged line)
Now, the finish touch:
Selections / Modify / Select selection borders
-> Both sides
Anti-alias checked
Border width : 2
THE PAINTSHOP PRO COOKBOOK - GENEALOGY WITH PAINTSHOP PRO
Installed PSP Ultimate: X7, X9, 2018, 2019, 2020, 2021, 2022, 2023
Installed PSP Ultimate: X7, X9, 2018, 2019, 2020, 2021, 2022, 2023
-
terrypin
- Posts: 492
- Joined: Tue Jun 29, 2010 9:51 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Asus Z170 Pro 4
- processor: Intel Core i7 6700K 4.0GHz
- ram: 32 GB
- Video Card: None - uses built-in graphics
- sound_card: HD onboard sound card
- Hard_Drive_Capacity: 4.256 TB
- Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
- Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
- Location: East Grinstead UK
Re: Smoothing a line?
Thanks, much appreciated. I'll persevere, but one snag seems to be that when I get to the right hand edge of the line, d-click, and then fill that, I get this:
https://www.dropbox.com/s/n0r25q9q1ytg4 ... .jpg?raw=1
Leaving a fair bit of editing left to do.
https://www.dropbox.com/s/n0r25q9q1ytg4 ... .jpg?raw=1
Leaving a fair bit of editing left to do.
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
-
JoeB
- Posts: 2778
- Joined: Fri Mar 28, 2008 10:04 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: LENOVO 4524PE4 ThinkCentre M91p
- processor: 3.10 gigahertz Intel Quad Core i5-2400
- ram: 8 GB
- Hard_Drive_Capacity: 4.6 TB
- Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
- Location: Canada
Re: Smoothing a line?
Whose method did you follow? It sound's like it was Jean-Luc's, because you wouldn't need to fill if you had used the paintbrush option.terrypin wrote:Thanks, much appreciated. I'll persevere, but one snag seems to be that when I get to the right hand edge of the line, d-click, and then fill that, I get this:
https://www.dropbox.com/s/n0r25q9q1ytg4 ... .jpg?raw=1
Leaving a fair bit of editing left to do.
Also, how much smoothing of the jaggies in the original do you want to do? Do you want it to be completely rounded as in Jean-Luc's attachment, or do you want to follow some of the irregularities to some extent but with a much wider line (as per my attachment)?
Regards,
JoeB
Using PSP 2019 64bit
JoeB
Using PSP 2019 64bit
-
terrypin
- Posts: 492
- Joined: Tue Jun 29, 2010 9:51 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Asus Z170 Pro 4
- processor: Intel Core i7 6700K 4.0GHz
- ram: 32 GB
- Video Card: None - uses built-in graphics
- sound_card: HD onboard sound card
- Hard_Drive_Capacity: 4.256 TB
- Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
- Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
- Location: East Grinstead UK
Re: Smoothing a line?
Your example shows the sort of result I want. But I want an automated solution like Jean-Luc’s, as I will be doing this many times.
Another method I’ll try when I get back to my PC. Change the jagged line to a distinctive colour and somehow make it solid and continuous. I can then select it and enlarge it by a pixel or two.
Another method I’ll try when I get back to my PC. Change the jagged line to a distinctive colour and somehow make it solid and continuous. I can then select it and enlarge it by a pixel or two.
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
-
JoeB
- Posts: 2778
- Joined: Fri Mar 28, 2008 10:04 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: LENOVO 4524PE4 ThinkCentre M91p
- processor: 3.10 gigahertz Intel Quad Core i5-2400
- ram: 8 GB
- Hard_Drive_Capacity: 4.6 TB
- Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
- Location: Canada
Re: Smoothing a line?
I'm afraid that Jean-Luc's method is not an automated solution because you still have to trace over the existing line, just with the selection tool rather than a paintbrush. And then you still have to follow other steps to color it, whereas the paintbrush does the coloring as you do the tracing.terrypin wrote:Your example shows the sort of result I want. But I want an automated solution like Jean-Luc’s, as I will be doing this many times.
Another method I’ll try when I get back to my PC. Change the jagged line to a distinctive colour and somehow make it solid and continuous. I can then select it and enlarge it by a pixel or two.
I'm afraid I don't see any way of changing the existing jagged line in any way, shape or form that doesn't require selecting it first with one of the Selection tools.
Regards,
JoeB
Using PSP 2019 64bit
JoeB
Using PSP 2019 64bit
-
photodrawken
- Posts: 684
- Joined: Wed Sep 26, 2012 8:40 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- ram: 16Gb
- Hard_Drive_Capacity: 324Gb
- Location: USA
Re: Smoothing a line?
I took a different approach -- instead of trying to deal with the crappy line, I worked with the area beneath the line.
All this work was done in PhotoLine, so PSP users will have to modify the steps, but in general, I
All this work was done in PhotoLine, so PSP users will have to modify the steps, but in general, I
- Selected the green area beneath the curve.
- Modified the selection to change the marquee to a bordered marquee of 2px..
- Put that bordered marquee on its own layer.
- Converted that bordered marquee layer to a vector shape.
- Smoothed the vector shape and coloured its line.
Ken
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
-
JoeB
- Posts: 2778
- Joined: Fri Mar 28, 2008 10:04 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: LENOVO 4524PE4 ThinkCentre M91p
- processor: 3.10 gigahertz Intel Quad Core i5-2400
- ram: 8 GB
- Hard_Drive_Capacity: 4.6 TB
- Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
- Location: Canada
Re: Smoothing a line?
Your approach has merit - i.e., starting from selecting the easy part, the green inside the lines. That makes the selection much easier, and the other steps can, for the most part, be done quickly. But your instructions as described doesn't help for PSP users if they don't have an option to convert a raster selection to a vector shape. Not that I think that's necessary anyway.
I can use your steps - without having a vector shape - by simply make a border with the raster selection selection marquee to fill it. Using anti-alias and some feathering from the Selection modify options keeps things pretty smooth. Of course, that means it fills along the bottom also, which is what happened with your image also. However, the bottom filled part can then be deleted because the selection has been promoted to its own layer.
Some steps could be sped up by scripting the sequence (so that users don't have to continually select items from the menu bar) and allowing the user to make changes to the size of the border, etc., to accommodate images of different sizes and then auto filling with color.
I can use your steps - without having a vector shape - by simply make a border with the raster selection selection marquee to fill it. Using anti-alias and some feathering from the Selection modify options keeps things pretty smooth. Of course, that means it fills along the bottom also, which is what happened with your image also. However, the bottom filled part can then be deleted because the selection has been promoted to its own layer.
Some steps could be sped up by scripting the sequence (so that users don't have to continually select items from the menu bar) and allowing the user to make changes to the size of the border, etc., to accommodate images of different sizes and then auto filling with color.
Regards,
JoeB
Using PSP 2019 64bit
JoeB
Using PSP 2019 64bit
-
photodrawken
- Posts: 684
- Joined: Wed Sep 26, 2012 8:40 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- ram: 16Gb
- Hard_Drive_Capacity: 324Gb
- Location: USA
Re: Smoothing a line?
Yes. That's the main point of my message.JoeB wrote: Your approach has some merit (i.e., starting from selecting the easy part, the green inside the lines). Something can be done with that.
No, I haven't had PSP available for years.JoeB wrote: But your instructions from a different program don't help as described for PSP users if they don't have an option to convert a raster selection to a vector shape. I believe you had PSP and so likely still have it available.
There's always a problem with interpreting one program's capabilities to another program, but even if the steps are different, it might be worth experimenting to see if the suggestion can lead to a series of steps that can achieve the desired result.
All I'm trying to do with this suggestion is to enlarge the focus of the discussion from using the line to using another property of the original image.
Ken
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
- hartpaul
- Advisor
- Posts: 2893
- Joined: Tue Mar 20, 2012 3:38 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: ASUSTeK P7P55D STRIX B240F GAMING
- processor: IntelCore i7 7700 3.60 Ghz
- ram: 8 Gb
- Video Card: Nvidia GeForce GTX 1050
- sound_card: Nvidia High Definition Audio
- Hard_Drive_Capacity: 1000 Gb
- Monitor/Display Make & Model: AOC
- Corel programs: PSP8,X2 to X9,2018,2019,2020
- Location: Australia
Re: Smoothing a line?
Here is my attempt done in Jasc PSP8:
1. Increase the size to 5000 pixels on longest side
2. Promote background to layer. Duplicate
3. Make bottom layer active use magic wand Match Mode RGB. Tolerance 20 , click to select the green part.
4. Make second layer active. Fill selection with a color.
5. Selections > Modify > Expand 22 pixels. You will now find a white border outside the colored area included in the selection.
6 Flood fill that white border with the color you wan the line to be. I chose blue. Match mode RGB value Tolerance 40.
7. Selections > Modify > Contract 22 pixels. Hit delete and see the color disappear leaving the blue outer line and your green background. You may have to tidy up some bleed around the ends and bottom, but this could be stopped by drawing a black line at the ends of the graph area to avoid the bleed.
8. Selections > Select None : Image resize back to 1340 pixels and the line now becomes a smoothed line about 4 pixels wide. (1340 /5000 ) * 22 pixels.
1. Increase the size to 5000 pixels on longest side
2. Promote background to layer. Duplicate
3. Make bottom layer active use magic wand Match Mode RGB. Tolerance 20 , click to select the green part.
4. Make second layer active. Fill selection with a color.
5. Selections > Modify > Expand 22 pixels. You will now find a white border outside the colored area included in the selection.
6 Flood fill that white border with the color you wan the line to be. I chose blue. Match mode RGB value Tolerance 40.
7. Selections > Modify > Contract 22 pixels. Hit delete and see the color disappear leaving the blue outer line and your green background. You may have to tidy up some bleed around the ends and bottom, but this could be stopped by drawing a black line at the ends of the graph area to avoid the bleed.
8. Selections > Select None : Image resize back to 1340 pixels and the line now becomes a smoothed line about 4 pixels wide. (1340 /5000 ) * 22 pixels.
Systems available Win7, Win 8.1,Win 10 Version 1607 Build 14393.2007 & version 20H2 Build 19042.867
-
Jean-Luc
- Advisor
- Posts: 2177
- Joined: Sat Oct 22, 2011 10:50 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: ASUS Computer N751J
- processor: Intel i7_4710 HQ 2_50GHz
- ram: 16GB
- Video Card: NVIDIA GeForce GTX 850M
- sound_card: NVIDIA High Definition Audio
- Hard_Drive_Capacity: 2 Tb
- Monitor/Display Make & Model: NVIDIA GeForce GTX 850M
- Corel programs: PSP X7, X9, 2018 to 2023
- Location: Belgium (French speaking)
- Contact:
Re: Smoothing a line?
Aargh ! You didn't say you wanted an automated solution. As JoeB says, my solution is more a "one shot" solution and is not fully automated. But as I suggested to use a selection and some users here jumped into the selection solution, it should be automated. HartPaul's solution is scriptable and, so, full automated.terrypin wrote:Your example shows the sort of result I want. But I want an automated solution like Jean-Luc’s, as I will be doing this many times.
It is an interesting challenge you submitted !
:>)
THE PAINTSHOP PRO COOKBOOK - GENEALOGY WITH PAINTSHOP PRO
Installed PSP Ultimate: X7, X9, 2018, 2019, 2020, 2021, 2022, 2023
Installed PSP Ultimate: X7, X9, 2018, 2019, 2020, 2021, 2022, 2023
-
terrypin
- Posts: 492
- Joined: Tue Jun 29, 2010 9:51 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Asus Z170 Pro 4
- processor: Intel Core i7 6700K 4.0GHz
- ram: 32 GB
- Video Card: None - uses built-in graphics
- sound_card: HD onboard sound card
- Hard_Drive_Capacity: 4.256 TB
- Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
- Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
- Location: East Grinstead UK
Re: Smoothing a line?
Thanks Paul, that looks very promising. I'm trying it now but getting myself a bit confused over which layer to operate on. After step 2 my layers are like this:
https://www.dropbox.com/s/zfa5aon31x9y9 ... .jpg?raw=1
In your next two steps
3. Make bottom layer active...
4. Make second layer active...
could you define "bottom layer" and "second layer" with my labels please?
I usually get this short term confusion when stepping straight out of my video editor, whose 'layers' (tracks) are reversed; track 1 being hidden by track 2, and so on:
https://www.dropbox.com/s/48xli56wgrrqd ... .jpg?raw=1
https://www.dropbox.com/s/zfa5aon31x9y9 ... .jpg?raw=1
In your next two steps
3. Make bottom layer active...
4. Make second layer active...
could you define "bottom layer" and "second layer" with my labels please?
I usually get this short term confusion when stepping straight out of my video editor, whose 'layers' (tracks) are reversed; track 1 being hidden by track 2, and so on:
https://www.dropbox.com/s/48xli56wgrrqd ... .jpg?raw=1
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
-
terrypin
- Posts: 492
- Joined: Tue Jun 29, 2010 9:51 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Asus Z170 Pro 4
- processor: Intel Core i7 6700K 4.0GHz
- ram: 32 GB
- Video Card: None - uses built-in graphics
- sound_card: HD onboard sound card
- Hard_Drive_Capacity: 4.256 TB
- Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
- Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
- Location: East Grinstead UK
Re: Smoothing a line?
Thanks Jean-Luc. Yes, I should have added that once I'd got a working solution I would attempt to script it - for which I would undoubtedly need help!
Also, I see that I muddied the water a bit with my later (red/pink) example. As always, the devil is in the details and the profile lines of my two examples differ significantly when zoomed in.
I'm also reconsidering the effectiveness of any method based on covering up or expanding the original jagged line. Even in the best result so far, from hartpaul, you can see unrealistic, vertical steps. I might instead focus on smoothing the original GPS recorded track mathematically.
That would still leave me frequently needing a method for making lines of various types thicker, more prominent, etc, so this is all useful learning for me.
Also, I see that I muddied the water a bit with my later (red/pink) example. As always, the devil is in the details and the profile lines of my two examples differ significantly when zoomed in.
I'm also reconsidering the effectiveness of any method based on covering up or expanding the original jagged line. Even in the best result so far, from hartpaul, you can see unrealistic, vertical steps. I might instead focus on smoothing the original GPS recorded track mathematically.
That would still leave me frequently needing a method for making lines of various types thicker, more prominent, etc, so this is all useful learning for me.
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
-
terrypin
- Posts: 492
- Joined: Tue Jun 29, 2010 9:51 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Asus Z170 Pro 4
- processor: Intel Core i7 6700K 4.0GHz
- ram: 32 GB
- Video Card: None - uses built-in graphics
- sound_card: HD onboard sound card
- Hard_Drive_Capacity: 4.256 TB
- Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
- Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
- Location: East Grinstead UK
Re: Smoothing a line?
Ken, JoeB: Thanks both, appreciate those clever suggestions. I'd been turning over similar ideas, albeit vague, but along the lines of attempting to first remove all content except 'the line'. Then work on that, finally making a transparent PNG of the clean line and superimposing that over the original.
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
