Gimp-Forum.net
Add new paint method ? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: Add new paint method ? (/Thread-Add-new-paint-method)

Pages: 1 2


RE: Add new paint method ? - Ofnuts - 02-07-2019

Everything is beyond the Browse... button in the script-fu console. But what I meant is that most of the code above is part of plain Python. In Python all objects have a __str__ method that returns the string representation, and a __repr__ one that returns an unambiguous string representation (so number 123 is 123 while string 123 is '123'). And format strings have %s and %r to choose between the two...


RE: Add new paint method ? - Jack Parker - 02-16-2019

Quote:Of course, there is almost half a century between Lisp and Python Smile

To clarify what ofnuts is saying (for the youth out there):
Lisp invented functional programing, code-macros, object-oriented, DSLs (via reader macros), dynamic typing, dynamic code generation, interactive coding, interactive/graphic programming environments, syntax-aware editors (and all of emacs);

But as you say, half a century later, other languages are getting there.


RE: Add new paint method ? - Ofnuts - 02-16-2019

(02-16-2019, 08:03 PM)JackĀ Parker Wrote:
Quote:Of course, there is almost half a century between Lisp and Python Smile

To clarify what ofnuts is saying (for the youth out there):
Lisp invented functional programing, code-macros, object-oriented, DSLs (via reader macros), dynamic typing, dynamic code generation, interactive coding, interactive/graphic programming environments, syntax-aware editors (and all of emacs);

But as you say, half a century later, other languages are getting there.

Agreed, even though I think you forgot relational databases, and the whole of AI. Lisp is such a perfect language that it is inĀ everyone's mind and everybody uses it.


RE: Add new paint method ? - Jack Parker - 02-20-2019

Yes, the list of Lisp breakthroughs goes on and on.
And yet: Lisp is so simple and obvious that people don't need to search the Internet to learn/use it.
(unlike some other languages for which people are constantly looking for answers)

Beyond Greenspun's tenth rule, we also note:
"every sufficiently advanced programming language re-invents a subset of Lisp"
When *that* language is then "complete", noobs declare that it is "too complicated"
So somebody invents a small, simple, easy to use, interpreter that makes *some* problem simple to program..
[it just needs a few more feature to be more widely useful... evolve and repeat]

That being said, is there a function in GIMP to compute the 'distance' between two colors?


RE: Add new paint method ? - Ofnuts - 02-20-2019

I assume you take the Wright brother's Flyer to travel... After all, all planes derive from it, right?

As to the function, looking at the source code for the fuzzy selector, it just computes the absolute value of the difference between channels (R,G,B or L,C,H)(and takes the max of the R/G/B differences for "composite").