It is currently Fri Aug 21, 2026 8:32 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: With gmic standalone how to execute commands a la filter with gimp
PostPosted: Sun Jan 13, 2013 11:27 pm  (#1) 
Offline
New Member

Joined: Jan 13, 2013
Posts: 2
Is it possible to execute with gmic in the standalone version somehow commands that resemble the same functionality of many of the filters
in gimp,

for example, if I wanted to use Enhancement -> Smooth [patch-based] with the following configuration:

Spatial variance 10.00
Patch variance 10.00
Patch size 3
Lookup size 5
Patch smoothness 0.00

Fast approximation checked
Iterations 1

Channel(s) All

How would I execute that through the command shield, cmd in Windows (will end up using Linux in production afterwards nevertheless)
And be able to apply it to an image.

I want to get to this to use it for an "Age wrinkles reducer" filter that gets executed with PHP for any uploaded image - out of a large set of filters I am implementing from both, ImageMagick and Gmic.
:paint

Out of topic but maybe you have the answer, for commercial use of gmic must someone be contacted and payed upon accordingly, for a commercial website.

I just read about Cecil license on wikipedia, sorted ou this question, still I'm interested into getting able to sue gmic filters via the commmand line.

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: With gmic standalone how to execute commands a la filter with gimp
PostPosted: Mon Jan 14, 2013 3:59 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
In the G'MIC plug-in for GIMP, set the 'Output messages' box (on the left pane) to 'Verbose (logfile)'. Each time you will run a filter, there will be the equivalent command line put in the log file, so you can reproduce it from the command line.
For instance, if I select this filter :
Image
and click 'Apply', I'll get this in the logfile :

Quote:
[gmic_gimp]./preview/ -v -99 -gimp_blur_angular 2,0.5,0.5,0,0,0

[gmic_gimp]./apply/ -v -99 -gimp_blur_angular 2,0.5,0.5,0,0,0


The first line corresponds to the equivalent 'gmic' call for generating the preview image, while the second one is the application of the filter on the real image. So now, if you want to do the same with the command line tool 'gmic', just type on the terminal :

Quote:
gmic input.jpg -gimp_blur_angular 2,0.5,0.5,0,0,0 -o output.jpg


and you will get the same result as with the plug-in for GIMP. The logfile is located in '/tmp/gmic_log' on Linux, and '%TEMP/gmic_log' on Windows.

Concerning the commercial use of G'MIC : G'MIC is distributed under the CeCILL license, which is *compatible* with the GPL, so you can imagine that the restrictions are the same as with a GPL license.
This means that if you are using parts (modified or not) of the G'MIC source code in your own product, you need to open the code of your app too. On the contrary, if you are using G'MIC as it is, without integrating it in your own sources (for instance if you are using 'gmic' on a web server), then you can do what you want with it, the only restriction being you must tell somewhere you are using it and link to his webpage.
There are already some web services that do that (http://superphotoapp.com/ for instance), and this is perfectly legal. Note that we morally appreciate small donations if you succeed in making money with it (though this is not mandatory of course).

Finally, if you need a specific license of use to be able to integrate the G'MIC source code (as a C++ library for instance) in your own (closed-source) product, this could be still possible. Contact me directly for such a request.

Cheers,

David.


Top
 Post subject: Re: With gmic standalone how to execute commands a la filter with gimp
PostPosted: Mon Jan 14, 2013 1:04 pm  (#3) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Also set the output to "new layer" will do the trick

If you get the habit to modify the gmic output of the plugin from default "in place-active layer(s)" and you save the xcf you may always recover the parameter used :
In the new layer name will be embedded the command used ready to be recovered as preset or as command for the command line version

Example Layer name after running gmic [G'MIC] Array [mirrored] :-gimp_array_mirror 1,0,0,2,0,0,0

equivalent for the command line -gimp_array_mirror 1,0,0,2,0,0

Note ; you usually have to delete the last parameters , here 0 , -gimp_array_mirror 1,0,0,2,0,0,0 because usually it refers to the preview so has no sense for the command line

Anyway not all the filters in the plugin have a preview, and i noticed that luckily if the extra parameter (that for the plugin preview ) s remain by mistake somehow the command line often forgive the error

I believe this that embed the command as new layer name be a undocumented feature but i found really cool ...for me was and is very useful

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: With gmic standalone how to execute commands a la filter with gimp
PostPosted: Fri Jan 18, 2013 10:35 pm  (#4) 
Offline
New Member

Joined: Jan 13, 2013
Posts: 2
Thank you for your answers, I purchased my first dedicated server in 25 years! to go ahead with gmic production, now I don't find on the Internet a standalone version for linux, was using a standalone version for windows which I just installed at C:/gmic and run it from the command line as gmic command, was planning on doing the same with linux but can't find the standalone version of it somewhere.

I get the file gmic_gimp to be copied to the plug-ins directory of gimp but I would need a specific standalone version to run gmic specific commands from the command line or there is a special twist to get it to work running gimp first, gimp + the gmic commands afterwards; any links to tutorials if this were the case, or a simple explanation.

I just got used to use the command line for the standalone version while developing custom filters in Windows. Thanks

From reading in the forums it seems it is already an executable (would work as standalone as well and is used by gimp) - thanks guys, will check this out, very happy with this software.


Top
 Post subject: Re: With gmic standalone how to execute commands a la filter with gimp
PostPosted: Sat Jan 19, 2013 4:22 am  (#5) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2613
Definitely there, I was updating a couple of days ago. Sourceforge seems down at the moment, so I no link, but the 32 bit archive was gmic_static1.5.3.0_linux.zip, contains the executable + a couple of readme's. I can't remember if there was a 64 bit there.

Looks like this.

Image

using PClinuxOS 32 bit (no version - it is a rolling release)


Top
 Post subject: Re: With gmic standalone how to execute commands a la filter with gimp
PostPosted: Sat Jan 19, 2013 4:50 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Yes, the static versions of G'MIC (which exist for 32 *and* 64 bits version on Linux) are intended to be very easy to be distributed, and should work probably on all major linux distros, as they depend on a minimal number of libraries. But, they don't have all the features of the usual binary version of 'gmic' (that you may recompile yourself or you will find in the proposed .deb packages).
But for putting it on a web server, or using it from another program, static versions are sufficient I think.


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group