It is currently Fri Mar 29, 2024 12:47 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Curve presets (for Contours)
PostPosted: Mon Nov 05, 2012 11:08 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
How can i use the script code values of a curve for making a curve preset ?

For example: these values are used in layerfx.scm to create what i believe is the Cone Contour:
#(0 64 94 74 150 115 179 179 191 255)

Is there a simple way of transforming these numbers into a curve preset without doing it manually in the curves tool and saving the curve ?

Explanation: if i had a curve preset for each Contour, i could shape the appearance of an outer glow (for example) without using the layerfx script. That would be neat.


Last edited by Esper on Wed Nov 07, 2012 10:38 am, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Curve presets
PostPosted: Mon Nov 05, 2012 11:21 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Esper Manually doing the curve is the only way i know of, saving the curve, then adding to presets

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Curve presets
PostPosted: Mon Nov 05, 2012 11:27 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
i see
problem is, how do i shape such a complicated curve manually ?

#(0 5 9 13 16 19 22 25 27 29 30 32 33 34 35 36 38 39 40 41 43 44 46 47 48 49 50 51 52 53 54 55 55 56 56 57 57 58 58 59 59 59 60 60 60 61 61 61 61 62 62 62 62 62 63 63 63 63 63 63 64 64 64 64 64 71 75 78 81 84 86 89 91 93 95 96 98 99 101 102 103 104 105 107 107 108 110 111 112 113 114 115 116 117 118 119 119 120 121 121 122 123 123 123 124 124 124 125 125 125 125 125 125 125 126 126 126 126 126 126 126 125 125 125 125 125 125 125 125 130 134 137 141 145 148 151 153 156 158 160 162 163 165 166 167 168 170 171 171 172 173 174 175 176 177 178 178 179 180 181 181 182 183 183 184 184 185 185 186 186 187 187 188 188 189 189 189 189 190 190 190 190 191 191 191 191 191 191 191 191 191 191 193 194 196 197 198 200 201 203 204 205 207 208 209 211 212 213 214 215 217 218 219 220 220 221 222 222 223 223 224 224 224 224 224 223 223 222 222 221 221 220 219 218 217 216 215 214 213 212 211 210 209 208 206 205 204 203 202 200 199 198 197 196 194 194)


or can i download the layerfx contour curves somewhere ?
i tried a google search but found nothing yet


Top
 Post subject: Re: Curve presets
PostPosted: Mon Nov 05, 2012 11:49 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
judging from this link, it appears the curve is shaped the same way the photoshop contours diagram looks like....
http://www.tipsquirrel.com/understandin ... photoshop/


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 12:32 am  (#5) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Esper I can see your problem better now but I don't understand contours or weather they actually exist in gimp the best is I must assume they are curves

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 3:01 am  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
The following function might serve as a starting point for playing around with things. It only works for the Value channel (the only channel used by the layerfx script) and it does not produce "presets"; it produces text files that can be imported using the Curves dialog context menu.

The curve should be provided in the same vector format as supplied in the Layerfx script. Also, note that if you want the file to be stored in your GIMP curves directory (~/<username>/.gimp-2.x/curves), recognize that GIMP does not understand either "~" or "$HOME" and you need to provide the full path.

After importing a "smooth" curve, GIMP does not seem to apply it immediately -- you need to "jiggle" one of the curve points to be able to preview. I may be missing something in the curve file I am generating, but I don't expect to be pursuing things much further. Have fun!

; filename: "/home/saul/.gimp-2.8/curves/test.curve"
; curve: #(0 255 127 0 255 255)
;    or: #(0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 127 125 123 121 119 117 115 113 111 109 107 105 103 101 99 97 95 93 91 89 87 85 83 81 79 77 75 73 71 69 67 65 63 61 59 57 55 53 51 49 47 45 43 41 39 37 35 33 31 29 27 25 23 21 19 17 15 13 11 9 7 5 3 1 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 128 126 124 122 120 118 116 114 112 110 108 106 104 102 100 98 96 94 92 90 88 86 84 82 80 78 76 74 72 70 68 66 64 62 60 58 56 54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 18 16 14 12 10 8 6 4 2)
       
(define (save-curve filename curve)
  (let* ((points (map (lambda (x) (/ x 255.0)) (vector->list curve)))
         (len (length points)) )
    (if (= len 256)
      ; freehand curve of 256 values
      (with-output-to-file filename (lambda ()
        (display "# GIMP curves tool settings\n\n(time 0)\n(channel value)\n(curve\n    (curve-type free)\n    (n-points 17)\n    (points 34 0.000000 0.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 1.000000 1.000000)\n    (n-samples 256)\n    ")
        (display (cons 'samples (cons 256 points)))
        (display ")") ))
      ; else we save a smooth curve
      (with-output-to-file filename (lambda ()
        (display "# GIMP curves tool settings\n\n(time 0)\n(channel value)\n(curve\n    (curve-type smooth)\n    (n-points 17)\n    ")
        (display (append (cons 'points (cons 34 points))
                         (make-list (- 34 len 2) -1.0)
                         '(1.0 1.0) ))
        (display ")\n") )))))

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 6:59 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Aug 24, 2011
Posts: 1785
Location: Dallas, TX
Whoa! Great explanation (I'm sure) but too complicated for my Neanderthal brain. I just did the same thing Graechan suggested and just reproduced the contours and saved them as presets using the Curves dialog. I used the numbers (in sequential pairs) to plot the curve using the numbers that appear at the top left of Curves dialog as yo move your cursor.

Image

Image

_________________
Image


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 8:47 am  (#8) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Attached is a zip file containing all the curves.

Archive:  curves.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  11-06-2012 08:54   curves/
    13907  11-06-2012 08:41   curves/Cone
    13907  11-06-2012 08:42   curves/Cone-Inverted
    13903  11-06-2012 08:43   curves/Cove-Deep
    13899  11-06-2012 08:44   curves/Cove-Shallow
    13895  11-06-2012 08:46   curves/Gaussian
    13903  11-06-2012 08:47   curves/Halfround
    13895  11-06-2012 08:48   curves/Ring
    13895  11-06-2012 08:49   curves/Ring-Double
    13903  11-06-2012 08:52   curves/Rollingslope-Descending
    13909  11-06-2012 08:53   curves/RoundedSteps
    13909  11-06-2012 08:54   curves/Sawtooth1
---------                     -------
   152925                     12 files


Attachments:
curves.zip [20.86 KiB]
Downloaded 217 times

_________________
Any sufficiently primitive technology is indistinguishable from a rock.
Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 8:49 am  (#9) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Wow, thanks Saul, cool

_________________
Image


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 10:43 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
thank you saulgoode
im afraid i dont understand quite what to do with the code you provided
is this a script ?
i tried to paste the code into my editor and save it as an .scm file in my scripts folder but so far i cant seem to find any curve ?
am i missing something ? sorry if thats a dumb question

the curves you attached would be exactly what i needed, but unfortunately there are some problems
firstly some of the curves are not what they are called
in fact Gaussian, Halfround, Cove deep and Cove shallow all have the same curve

second: when i try to play around with the cone curve preset, it just changes into something completely different

last question: how do i produce a curve with a sharp angle, as in sawtooth
all i get are rounded angles


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 12:50 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2231
Location: Poland
My file collection - 100 curves (Curves2.zip) - may be useful to someone ...

List 100 curves:
Abao-color-lba; Alien; Beam-gradient; Blue light; Blue pastel; Blues; Bright tea party; Bright-red; Bronze; Candy sunset; Classic-hdr; Classic-lomo; Classic-studio; Cold-blue; Cold-green; Cold-purple; Colorful-glow; Corssprocess; Curve1; Curve2; Curve3; Curve4; Curve5; Dark tea party; Deep-blue; Elegant; Elsamuko-autumn; Elsamuko-blue; Elsamuko-green; Elsamuko-light-blue; Elsamuko-redscale; Evening walk; Fairybox; Farm shed; Film; Gothic-style; Green light; Green pastel; Hdr; High-flesh; High-pink; High-whitening; Ice-spirit; Imperial dominance; Impression; Japanese; Life-sketch; Light tea party; Little-flesh; Little-fresh; Little-pink; Little-whitening; Max chrome; Medium chrome; Midnight throne; Milk; Moderate-flesh; Moderate-pink; Moderate-whitening; New-japanese; Night-view; Ocean; Old-photos; Peach; Pink-blue-gradient; Pink-lady; Polaroid 600 expired; Polaroid 600 expired run; Polluted moon; Portra; Provia; Purple dream; Purple-fantasy; Purple-sensation; Rainbow-gradient; Rainforest; Red light; Red pastel; Retro; Retro-lomo; Rose cream; Shadow extreme; Smart-color; Soft; Soft chrome; Stars; Strong-contrast; Sunrise princess; Supernova; Twilight sky; Velvia; Vibrant; Warm; Warm-yellow; X; X1; X2; X3; X4; Yellowing-dark-corners.


Attachments:
Curves-2.zip [323.55 KiB]
Downloaded 185 times

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 1:02 pm  (#12) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thank you MareroQ. I will have to figure out how to use these. I put them in my user/curves folder

_________________
Image


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 1:43 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Aug 24, 2011
Posts: 1785
Location: Dallas, TX
Try these. Open the zip file and save to your Gimp "User" Curves folder.


Attachments:
PS Contours.7z [8.36 KiB]
Downloaded 154 times

_________________
Image
Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 2:16 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Aug 30, 2012
Posts: 2174
Saulgoode, MareroQ, Drac thanks for all the curves shall be spending sometime playing with all these.

_________________
Image


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 2:46 pm  (#15) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
molly wrote:
Thank you MareroQ. I will have to figure out how to use these. I put them in my user/curves folder

Molly, do you mean how to import the curves presets?
Image

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 3:02 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Aug 24, 2011
Posts: 1785
Location: Dallas, TX
Thanks Odin. Guess I should have included that part in my instructions.

_________________
Image


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 3:33 pm  (#17) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Esper wrote:
thank you saulgoode
im afraid i dont understand quite what to do with the code you provided
is this a script ?
It is a code fragment; it is not a complete Script-fu script. It was intended to either be pasted into the Script-fu console or incorporated into a script.

Esper wrote:
i tried to paste the code into my editor and save it as an .scm file in my scripts folder but so far i cant seem to find any curve ?
If you've done that, you can open "Filters->Script-fu->Console" and type in a command such as: (save-curve "/home/esper/Gauss.curve" #(0 0 33 8 64 38 97 102 128 166 158 209 191 235 222 247 255 255) )

and then Import the curve from the Curves dialog's menu.

Esper wrote:
the curves you attached would be exactly what i needed, but unfortunately there are some problems
firstly some of the curves are not what they are called
in fact Gaussian, Halfround, Cove deep and Cove shallow all have the same curve
I have investigated and that does not seem to be the case. Could you please double-check?

Esper wrote:
second: when i try to play around with the cone curve preset, it just changes into something completely different
I do not understand what you are saying.

Esper wrote:
last question: how do i produce a curve with a sharp angle, as in sawtooth
all i get are rounded angles
You need to first select the "Freehand" option from the Curve Type dropdown, and then have a steady hand while drawing in the preview window (I find this very difficult, though maybe it's easier with a graphics pad).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Curve presets
PostPosted: Tue Nov 06, 2012 8:31 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
saulgoode wrote:
It is a code fragment; it is not a complete Script-fu script. It was intended to either be pasted into the Script-fu console or incorporated into a script.

If you've done that, you can open "Filters->Script-fu->Console" and type in a command such as: (save-curve "/home/esper/Gauss.curve" #(0 0 33 8 64 38 97 102 128 166 158 209 191 235 222 247 255 255) )
and then Import the curve from the Curves dialog's menu.

thank you saulgoode, i understand almost nothing of scripts
i cant paste anything into the console, all i can do is paste something into the adress field or whatever it is called in english
Attachment:
Console.png
Console.png [ 35.74 KiB | Viewed 1444 times ]


saulgoode wrote:
I have investigated and that does not seem to be the case. Could you please double-check?
I did, and for Cove-deep; Cove-shallow; Gaussian and Half Round i get exactly the same curve (See screenshot)
all the other look like they should
Attachment:
Curve.png
Curve.png [ 42.7 KiB | Viewed 1447 times ]


thanks again for all the help - its very much appreciated !!

Draconian wrote:
Try these. Open the zip file and save to your Gimp "User" Curves folder.

thanks for these Drac but they dont seem to work for me
did you make them for the alpha channel ?
because everytime i open a preset its set on value and when i try to change it to alpha the nodes on the curve disappear but my blurred test-letter doesnt change


Top
 Post subject: Re: Curve presets
PostPosted: Wed Nov 07, 2012 5:55 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Aug 24, 2011
Posts: 1785
Location: Dallas, TX
All my curves are set to Value. Why are you trying to change it to alpha? Since it is the alpha, I would think there would not be anything to manipulate. I know one thing for sure, for chrome effects, you have to have gray text. If you use any color you get all kinds of distorted psychedelic weirdness.

There are a lot of things you can do with curves in photo editing to make adjustments as evidenced by most of those 100 curves that were posted above by MareoQ. I have no clue how to do anything with the alpha.

_________________
Image


Top
 Post subject: Re: Curve presets
PostPosted: Wed Nov 07, 2012 6:22 am  (#20) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Esper wrote:
because everytime i open a preset its set on value and when i try to change it to alpha the nodes on the curve disappear but my blurred test-letter doesnt change

The Alpha channel is a completely independent channel from the Value channel. When you "change it to alpha" what you are actually doing is switching over to edit the adjustment curve for the Alpha channel -- the curve that you had entered for the Value channel (e.g., Draconian's preset) is still there, but you are not editing its handles because you are editing the Alpha channel.

This is similar to how you can edit the color channels independently. You can create a curve for the Blue channel (without affecting the Green or Red channels), and then you can switch to editing the Red channel (your Blue curve won't be affected, nor will the Green).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Wed Nov 07, 2012 10:59 am, edited 1 time in total.

Top
Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Personal new plays (4-Aquilina108 with GMIC Contours)

30

No new posts Script-fu Curve Bend

4

No new posts Attachment(s) Curve Bend (warping text)

6

No new posts Attachment(s) Shift-Click lines to curve.

9

No new posts Plugin or Script to bend/curve text

17



* Login  



Powered by phpBB3 © phpBB Group