[Gimp-developer] Best way for "limit distance"

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

 




(I think this has been discussed on the list before, but not sure where/when.)

What is the best way to achieve the following functionality -

  Given two layers L1 and L2, I want L2 limited by it's distance from L1

      Result  <-  L1 - MIN( MAX(L1 - L2), -20), 20)

(This expression uses L1/L2 as placeholder for each pixel in all RGB channels)

Options:

A. Write a plugin

B. Write it as a script-fu (not sure if script-fu can iterate on pixels, and what is the speed implication). And I hate scheme.

C. Write it in python fu if I can compile it, but even though it is probably not as universally available as scrip-fu. Can I iterate over an image in python-fu?

D. I know I can do it with 5 layers and overlay modes. write this as a script-fu. Not elegant and requires loads of memory for large images.

 Layer   Mode

 L1     Grain Merge
148     Darken Only
108     Lighten Only
 L1     Grain Extract
 L2     Normal

(148/108 stand for a layer filled with gray pixels (148,148,148)/(108,108,108)

E. Write a generic framework which allows any kind of expression(s) between layer(s) (Only kidding ...)

F. Anything better?


-Joseph



[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