Re: Layer modes ported to GEGL, explanation of new compositing model

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Nov 10, 2008 at 9:18 AM, David Gowers <00ai99@xxxxxxxxx> wrote:
> I'll see what happens when I make that change :)
> (apparently just one line, app/core/gimpprojection.c:391, is needed to
> be changed to implement this now :D)

This was slightly more complex than I said.
Somewhat hackish diff attached.

It effects color tools as well as compositing. (that may be
controversial, since it changes the meaning of existing Levels, etc..
tool settings. It does mean you can do a proper linear inversion, and
recoloring with the Curves tool is a good deal more intuitive than
before. (recoloring with 'colorize' is VASTLY better than before --
the output actually is good quality :))

Easiest way to see the color-tool difference is to make a greyscale
gradient and use the Levels tool (set output minimum to 255 and output
maximum to 0, then toggle 'Colors->Use Gegl')

It exposes a bug in either the 'threshold' op, or babl. Try it with
default settings, on a greyscale B->W gradient, and notice #ffffff
becomes black rather than white

Of course, this does not fix the various places where we refer to
values in range 0...255 (eg Threshold dialog) where really, we should
use 0..1 or 0...100. IMO adjustment step-size needs to be carefully
thought out -- 1/255.
(0.0039215686274509803)
is actually wrong (because the adjustment is done in linear space; the
correct minimum step size is
0.00030352698354883752)


Lastly! I don't know whether this merges shadow-tiles in linear-light
RGB or not. It appears that it does, but I haven't run proper tests
yet :)

I am amazed and excited how easy this was :D


David


-- 
Reticience and self-censorship is a farce.  The deceiver does not
himself know the truth, anything that he holds back he holds back not
only from others but from himself. Fuck censorship. "I yam what I
yam."
Index: app/core/gimpimagemap.c
===================================================================
--- app/core/gimpimagemap.c	(revision 27590)
+++ app/core/gimpimagemap.c	(working copy)
@@ -536,7 +536,7 @@
 
       gegl_node_set (image_map->input,
                      "tile-manager", image_map->undo_tiles,
-                     "linear",       TRUE,
+                     "linear",       FALSE,
                      NULL);
 
       gegl_node_set (image_map->shift,
@@ -544,9 +544,12 @@
                      "y", (gdouble) rect.y,
                      NULL);
 
+
+      /* XXX it's not clear to me whether linear should be FALSE or TRUE here. 
+         I just went with the nicer-looking output */
       gegl_node_set (image_map->output,
                      "tile-manager", gimp_drawable_get_shadow_tiles (image_map->drawable),
-                     "linear",       TRUE,
+                     "linear",       FALSE,
                      NULL);
 
       image_map->processor = gegl_node_new_processor (image_map->output,
Index: app/core/gimpdrawable-operation.c
===================================================================
--- app/core/gimpdrawable-operation.c	(revision 27590)
+++ app/core/gimpdrawable-operation.c	(working copy)
@@ -76,12 +76,13 @@
   input  = gegl_node_new_child (gegl,
                                 "operation",    "gimp:tilemanager-source",
                                 "tile-manager", gimp_drawable_get_tiles (drawable),
-                                "linear",       linear,
+                                "linear",       !linear,
                                 NULL);
+  /* XXX is above correct? input and output are nonlin, op is lin */
   output = gegl_node_new_child (gegl,
                                 "operation",    "gimp:tilemanager-sink",
                                 "tile-manager", gimp_drawable_get_shadow_tiles (drawable),
-                                "linear",       linear,
+                                "linear",       !linear,
                                 NULL);
 
   gegl_node_add_child (gegl, operation);
Index: app/core/gimpprojection.c
===================================================================
--- app/core/gimpprojection.c	(revision 27590)
+++ app/core/gimpprojection.c	(working copy)
@@ -388,7 +388,7 @@
     gegl_node_new_child (proj->graph,
                          "operation",    "gimp:tilemanager-sink",
                          "tile-manager", gimp_projection_get_tiles (GIMP_PICKABLE (proj)),
-                         "linear",       TRUE,
+                         "linear",       FALSE,
                          NULL);
 
   gegl_node_connect_to (graph,           "output",
Index: app/core/gimpdrawable.c
===================================================================
--- app/core/gimpdrawable.c	(revision 27590)
+++ app/core/gimpdrawable.c	(working copy)
@@ -1227,7 +1227,7 @@
                                         NULL);
   gegl_node_set (drawable->source_node,
                  "tile-manager", drawable->tiles,
-                 "linear",       TRUE,
+                 "linear",       FALSE,
                  NULL);
 
   return drawable->source_node;
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux