It is currently Sun Jul 21, 2024 2:27 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: the 'Overlay-Mode' bug
PostPosted: Sun Mar 10, 2013 9:00 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
'Overlay' is the same as 'Soft Light' because of a bug

as this is just a simple formula, would it be possible for me to edit the bug on my own in my Gimp program ?

if so how ?



and in before anybody says Overlay is correct in G'MIC :mrgreen:
i know but i would rather have it in my layers-tab


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: the 'Overlay-Mode' bug
PostPosted: Sun Mar 10, 2013 10:43 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
It's not just the matter of changing the formula in GIMP file, Esper.

AFAIK, the formula for Overlay mode in GIMP is all right (pegtop's formula, IIRC). The problem is much bigger.
It is non-linear color conversion in GIMP. To that extent, ALL blend modes in GIMP are 'legacy' bugs and somewhat incorrect.
GEGL uses linear color conversion and gets Overlay mode correctly (as well as other blend modes),
you can downgrade to 2.8.0 where GEGL operations is/was still available under 'Colors' menu or wait for 2.10 release (with GIMP fully ported to GEGL).
Edit. Finally, found the thread I started 2 months ago, where I used Overlay mode made with GEGL in 2.8.0.

If you want to do it yourself, you can apply this patch to override "gfloat comp" in the gimpoperationoverlaymode.c and then compile it for Windows.
diff --git a/app/operations/gimpoperationoverlaymode.c b/app/operations/gimpoperationoverlaymode.c
index 611cf4e..70365ee 100644
--- a/app/operations/gimpoperationoverlaymode.c
+++ b/app/operations/gimpoperationoverlaymode.c
@@ -112,9 +112,19 @@ gimp_operation_overlay_mode_process (GeglOperation       *operation,

           for (b = RED; b < ALPHA; b++)
             {
-              gfloat comp = in[b] * (in[b] + (2.0 * layer[b]) * (1.0 - in[b]));
+               gfloat comp;
+             
+              if (in[b] < 0.5) {
+                  comp = 2.0 * in[b] * layer[b];
+              } else {
+              comp = 1.0 - 2.0 * (1.0 - layer[b]) * (1.0 - in[b]);
+              }             
+             
+            //  gfloat comp = in[b] * (in[b] + (2.0 * layer[b]) * (1.0 - in[b]));
+

               out[b] = comp * ratio + in[b] * (1.0 - ratio);
+
             }
         }
       else



Other options are
A. returning 'Use GEGL' ops as GIMP menu item to current 2.8.4 version but that would probably require rebuilding GIMP from the source code
B. finding such a 'Overlay-mode-bug-free' build somewhere.
C. using 2.9 custom builds (Partha's for one) but 2.9 is still not very good for production


Last edited by K1TesseraEna on Sun Mar 10, 2013 11:19 pm, edited 1 time in total.

Top
 Post subject: Re: the 'Overlay-Mode' bug
PostPosted: Sun Mar 10, 2013 10:59 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Esper have you thought of trying one of GMIC's layer mode's, theres a new one called vivid-light. also there easy to use set input layers to active and below, set output to new layers then select the layer you want to set the layer mode to i.e.it should have another layer below it

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


Last edited by Graechan on Sun Mar 10, 2013 11:14 pm, edited 1 time in total.

Top
 Post subject: Re: the 'Overlay-Mode' bug
PostPosted: Sun Mar 10, 2013 11:08 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Graechan wrote:
Esper have you thought of trying one of GMIC's layer mode's, theres a new one called vivid-light. also there easy to use set input layers to active and below, set output to new layers then select the layer you want to set the layer mode i.e.it should have another layer below it


Esper wrote:
and in before anybody says Overlay is correct in G'MIC :mrgreen:
i know but i would rather have it in my layers-tab


Top
 Post subject: Re: the 'Overlay-Mode' bug
PostPosted: Sun Mar 10, 2013 11:15 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
thanks K1te

i dont want to go back to 2.8 and i have no idea how to compile, whatever that actually means in my case as a windows user

waiting for Gimp 2.10 is all good, but as far as i understand, its in the somewhat far future

so no Overlay mode for me, except in G'MIC

i do not find all of this overly sensible, especially as coders probably like thinking logically
but whatever


Top
 Post subject: Re: the 'Overlay-Mode' bug
PostPosted: Sun Mar 10, 2013 11:26 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Woops! Esper I didn't notice you have already ruled out gmic, but for the sake of getting it right it's either that or leave it till 2.10 comes along

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


Top
 Post subject: Re: the 'Overlay-Mode' bug
PostPosted: Sun Mar 10, 2013 11:30 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
seems so, thanks Graechan


Top
 Post subject: Re: the 'Overlay-Mode' bug
PostPosted: Mon Mar 11, 2013 3:42 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Esper wrote:
i dont want to go back to 2.8 and i have no idea how to compile, whatever that actually means in my case as a windows user

i do not find all of this overly sensible, especially as coders probably like thinking logically
but whatever



well, it's a C programming language so you need a compiler to make it work on Windows/Linux/Mac, but if this is not much of a problem, it's not worth a headache of setting a compiler environment on your system, unless you also want to build GIMP from the git source code to get a newest version with fixed bugs or new features long before the next stable version official release.


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Pattern Overlay Errors

1

No new posts Attachment(s) GEGL Color Light Fusion (12 blend modes for color overlay)

9

No new posts Open images in RGB mode automatically

1

No new posts Attachment(s) Multiple Layers Attributes/Mode .scm Updated

0

No new posts Attachment(s) layer mode preview stopped working

3



* Login  



Powered by phpBB3 © phpBB Group