Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,934
» Latest member: W1tchseason
» Forum threads: 7,695
» Forum posts: 41,849

Full Statistics

Latest Threads
How to get G'MIC within G...
Forum: General questions
Last Post: Tas_mania
52 minutes ago
» Replies: 5
» Views: 355
"Mouseclick" is not recor...
Forum: General questions
Last Post: Ofnuts
1 hour ago
» Replies: 1
» Views: 83
Text Editor hardly ever w...
Forum: General questions
Last Post: sallyanne
Today, 09:23 AM
» Replies: 5
» Views: 422
Issue with cut selection
Forum: General questions
Last Post: rich2005
Today, 08:33 AM
» Replies: 4
» Views: 221
Colorized Layer Reverts t...
Forum: General questions
Last Post: sallyanne
Yesterday, 08:57 AM
» Replies: 6
» Views: 442
Gimp 3.0.6-1 G'Mic-Qt ups...
Forum: General questions
Last Post: denzjos
11-11-2025, 07:08 PM
» Replies: 2
» Views: 180
Gimp 3.x scanner xsane pl...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: Ofnuts
11-10-2025, 08:36 AM
» Replies: 14
» Views: 11,679
Gimp 3.0 get Metadata wit...
Forum: Scripting questions
Last Post: Volker
11-09-2025, 06:19 PM
» Replies: 3
» Views: 313
How to make image and mas...
Forum: Installation and usage
Last Post: Ofnuts
11-08-2025, 08:39 PM
» Replies: 5
» Views: 359
Multi window mode mode fa...
Forum: General questions
Last Post: teapot
11-07-2025, 01:40 PM
» Replies: 5
» Views: 510

 
  A simple function to use non-linear curves in Python
Posted by: Scallact - 10-27-2025, 05:20 PM - Forum: Extending the GIMP - No Replies

Hello,

I hit a wall when trying to convert one of my old v2python scripts making use of curves. The problem is that the curves_spline(...) API function works in linear space, with no option to use curves in non-linear space. Designing curves in linear space is a nightmare, so don't even start me on this ;-)

Simply converting the curves coordinates to linear don't work, as x values are compressed to the left, and the result is very, very ugly. The right way to do it would be to sample many points along the curve, by applying the Catmull-Rom splines algorithm, but these splines require 4 points to work, and I have no idea how GIMP calculates the first and last segments.

It seems I'm not the only one on the internet with this problem since 3.0, and all questions of this kind are generally left unanswered, so I wanted to share a mildly clever little hack I found here. 

The idea is to transform the coordinates values to linear, apply the non-linear spline curve, and transform back the values to the original non-linear space.If you find this back-and-forth confusing, so do I, but after much brain storming and many tests I can say that it works really well... except for 8 bits integer images which really don't like 3 consecutive operations in linear space!!! (please keep that in mind)!

Here is my code. Reuse it as you wish!



Code:
def srgb_curves_spline(drawable, channel, spline) :
    # GIMP 3.0 API curves functions only work in linear space. This function is a hack
    #   to reproduce the effect of a non-linear srgb spline curve.
    # IMPORTANT: this function does NOT work well with 8 bits integer images. 
    # The "spline" parameter is a list of x y coordinates of the spline points. 
    # See the GIMP API doc for the channel parameter...
    #   example: 'Gimp.HistogramChannel.VALUE' (without quotes)
    # Non-smooth points are not supported. 
    # License is GPL3: http://www.gnu.org/licenses/gpl.html
    
    samplecount = 1024 # count of equidistant samples in linear space
    
    linofx_curve = []
    srgbofx_curve = []
    i = 0
    
    while i < samplecount :
        
        # current step in linear space
        xlin = float(i) / (float(samplecount) - 1.0)
        
        # srgb to linear
        if xlin < 0.0031308 :
            linofx_curve.append( xlin * 12.92 )
        else :
            linofx_curve.append( 1.055 * xlin**(1.0/2.4) - 0.055 )
            
        # linear to srgb
        if xlin < 0.04045 :
            srgbofx_curve.append( xlin / 12.92 )
        else :
            srgbofx_curve.append( ( (xlin+0.055)/1.055 )**2.4 )
        
        i += 1
        
    # end while
    
    # apply the curve surrounded by a back-and-forth to linear space values
    # note that we don't change the color space of the image, it's just en intermediate 
    # representation of values 
    drawable.curves_explicit(channel, linofx_curve)
    drawable.curves_spline(channel, spline)
    drawable.curves_explicit(channel, srgbofx_curve)

    return


Notes: 
The default "srgb" color space is used for the non-linear space. If you really need curves in other spaces, change the transfer functions accordingly.
You can tweak the "samplecount" parameter for performance (down to 256). The value chosen (1024) ensures good quality conversion of dark values, but 256 is perfectly acceptable.

Print this item

  free e-on 3D software
Posted by: denzjos - 10-27-2025, 07:34 AM - Forum: Other graphics software - Replies (2)

e-on software products have served the media and entertainment industry for over 27 years. Following its acquisition by Bentley Systems in 2015, e-on software’s technologies have been integrated into various Bentley products and have been used by valued customers and partners world-wide.

For over 39 years, Bentley’s focus has been to serve engineers and other professionals responsible for designing, constructing, and operating sustainable infrastructure. To keep our focus, we have decided to end sales for VUE, PlantFactory, and PlantCatalog. These products will not be further developed, and support will be limited to critical security patches.

However, we are offering free downloads and usage of VUE, PlantFactory, and PlantCatalog as perpetual versions to anyone interested in continuing to utilize these products and technologies! Simply download the product and acknowledge the new end-user-license-agreement (EULA) agreeing to using the software without support.

https://www.bentley.com/software/e-on-so...-downloads

Print this item

  Gimp whimsy about wich monitor start in.
Posted by: mrkid - 10-23-2025, 06:22 PM - Forum: General questions - No Replies

Hi!. Im currently working in a three monitor setup. Handy. The problem i have with Gimp is that for some reason it starts each time where he wants. I want it starts in the main monitor, at center of the three. It is the main monitor on windows setup. But Gimp sometimes starts at right monitor, sometimes at middle, sometimes at left... Funny! But bother a little, you need to drag it, maximize, etc, before start to work.
I have changed preference in "Windows management" but no change. It still opens where it desires.
Any tip?
Edit: I found what happens. Gimp follows my mouse. If i move my mouse to another monitor after click GIMP icon, gimp opens where my mouse is placed. So... you need to waaaait gimp totally open, to continue working...

Print this item

  Copy content of channels into other ones
Posted by: top1r - 10-23-2025, 04:43 PM - Forum: General questions - Replies (2)

Hi, I would like to know how to copy the content of colors channels RGB (Red, Green and Blue) into Green, then copy the content of Alpha channel into Red ?

I tried it on PS and it was quite easy, but I can't manage to reproduce it on Gimp.

Thanks and have a good day !

Print this item

Thumbs Up Database error fixed on this forum today :)
Posted by: Tas_mania - 10-22-2025, 08:17 AM - Forum: Gimp-Forum.net - Replies (6)

I noticed this forum was down for awhile today. These errors are quite common and are mostly mysql database errors. From memory they usually mean stopping and re-starting the database but they need expert attention. Congratulations to the admins at Gimp-Forum Smile

Print this item

Bug "Open As Layers" in GIMP 3.0.6 doesn't include Layer Masks when using NDE effects
Posted by: PrincessAquos - 10-20-2025, 07:12 PM - Forum: General questions - Replies (3)

Hi Gimp forums,

I used to use GIMP 2.10, and recently updated to GIMP 3.0.6 to use the non-destructive editing for text effects.

My work often involves creating many sub-projects, and then compositing them together into one larger project. Keeping the sub-projects intact allows me to alter elements after importing to adjust the overall composition.

Naturally, when opening a project as layers, any elements outside the sub-project's canvas are no longer clipped off, due to the main project having a larger canvas.

For this reason, I started making the root layer of each sub-project a layer group, and using a layer mask to make only the parts within each sub-project's canvas visible when imported into the main project.

Normally, this works phenomenally.

However, when I tried to use NDE text effects in a sub-project today, I found that the presence of effects causes layer masks to not be imported when opening a project as layers.

At the moment, I can just merge down the effects before saving the sub-projects, but I would greatly prefer to keep these effects intact and editable.

The layer group I import each sub-project into has a layer mask of the same size, so the layer mask in the sub-project is more for the ease of lining up their boundaries. I could simply add a layer to each sub-project that paints a bounding box in black outside the canvas, thus making the sub-project's layer mask unnecessary. But making such an edit to all my sub-projects when I've been using a template with the layer mask already applied for a long time now feels like alot of tedious work.

I wanted to ask around if this was a known issue, perhaps one that has already been addressed in a development build, or if this is due to some limitation of how effect filters, masks, and open as layers interact, as well as any other potential workarounds.

Here's one of the sub-projects
[Image: attachment.php?aid=14002]

Here's the result when effects are active. Notice that the layer mask on "Pokemon LeafGreen.xcf" is missing
[Image: attachment.php?aid=14003]

Here's the result when the effects are merged down before saving and opening as layers. Notice that the sub-project is clipped at the bottom where the original sub-project's canvas boundary ended
[Image: attachment.php?aid=14004]

Any input, verification of this issue, anything, is greatly appreciated. Thanks!



Attached Files Thumbnail(s)
           
Print this item

  Seeking Gimp 3 version of Layer via Copy/Cut?
Posted by: Dizzy-noodles - 10-20-2025, 05:27 PM - Forum: General questions - Replies (1)

Hello everyone, I have used GIMP for a few years to make content for my Sims 2 game.

I had the plugin 'Layer via Copy/Cut' by Slybug and was very happy with it, on GIMP 2.8.

However, now I have GiIMP 3.0, and apparently cannot use the same plugin.

Does anyone know if there is an equivalent for GIMP 3.0 please?

Print this item

  Pandora or any morph prg
Posted by: Moreach - 10-20-2025, 04:45 AM - Forum: General questions - Replies (2)

I desperately want to morph some photos, a thing I used to enjoy doing in Windows programs.

Print this item

  cannot install upgrade
Posted by: Moreach - 10-20-2025, 04:42 AM - Forum: General questions - Replies (1)

I DLed GIMP 2.99 but nothing seems to happen when I tried to upgrade from 2.10 Huh

Print this item

  Clone from screen... do you believe it is usefull?
Posted by: mrkid - 10-19-2025, 11:45 AM - Forum: General questions - Replies (2)

Hi. Working on some photo retouching i found usefull to clone some details from other pictures, elements from background, textures, etc. Usually i navigate that stored photos trough some external program, like could be xnview. Would be interesting be able to "clone" from any portion of the screens you have, instead to open the file in Gimp.
just saying... Big Grin

Print this item