It is currently Thu Aug 20, 2026 6:07 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Modifying pixels with mathematical expressions?
PostPosted: Wed Aug 10, 2016 10:49 am  (#1) 
Offline
New Member

Joined: Aug 10, 2016
Posts: 2
I'd like to use G'MIC to modify pixels based on the results of calculations. For example, I'd might like to apply an expression that make pixels increasingly pastel toned based on their brightness, or to selectively darken pixels that are predominantly red.

Looking at

aitch-tee-tee-pee-ess
discuss.pixls.us/t/gmic-math-evaluator-now-deals-with-vectors-and-matrices-and-custom-functions/656

and

aitch-tee-tee-pee
gmic.eu/tutorial/gmic-color-mapping_median-cut-algorithm.shtml

(I had to hack the links above to get round spam detection.)

..I'm virtually certain G'MIC can do this, but before digging into the system I'd like to ask

1. Will it be reasonably efficient, or am I pushing the system outside of the uses it was designed for? Do people think G'MIC is likely to be faster than Processing for this type of task?

2. Am I right in thinking that those two links show the right way to go about this?

Thanks!


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: Modifying pixels with mathematical expressions?
PostPosted: Wed Aug 10, 2016 3:47 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Hello.
Maybe one question, could you precise if you are interested to process your image from the command line, or from the G'MIC plug-in for GIMP ?
If you are using the CLI tool, the command '-fill' can help, like this for instance :

$ gmic input.jpg -fill "[(R+G)/2,(R+B)/2,(G+B)/2]" -o output.jpg


The syntax of the formula can be in fact really complex, so you are not really limited in the things you can compute.
See corresponding section in reference documentation : http://gmic.eu/reference.shtml#section9


Top
 Post subject: Re: Modifying pixels with mathematical expressions?
PostPosted: Wed Aug 10, 2016 8:24 pm  (#3) 
Offline
New Member

Joined: Aug 10, 2016
Posts: 2
Ronounours wrote:
Hello.
Maybe one question, could you precise if you are interested to process your image from the command line, or from the G'MIC plug-in for GIMP ?


Sorry; that was sloppy of me. The command line.

Quote:
If you are using the CLI tool, the command '-fill' can help, like this for instance :

$ gmic input.jpg -fill "[(R+G)/2,(R+B)/2,(G+B)/2]" -o output.jpg


The syntax of the formula can be in fact really complex, so you are not really limited in the things you can compute.


Thank you. That's possibly the best forum answer I've ever had! Excellent news and that little code snippet tells me so much!


Top
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group