It is currently Tue Apr 23, 2024 11:15 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Gimp_Gmic Terminal command output field
PostPosted: Thu Mar 05, 2015 4:24 pm  (#1) 
Offline
GimpChat Member

Joined: Mar 05, 2015
Posts: 5
GIMP Version: 2.8.10
Operating System: Linux
GIMP Experience: Beginner Level



Hi
Could you add terminal command output field
for the filters

Terminal command:(-unsharp_octave 4,5,3 -cut 0,255)
./gmic test.png -unsharp_octave 4,5,3 -cut 0,255 test2.png


thx


Attachments:
Bildschirmfoto1.png
Bildschirmfoto1.png [ 380.55 KiB | Viewed 3042 times ]


Last edited by orti1980 on Thu Mar 05, 2015 4:53 pm, edited 1 time in total.
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: Gimp_Gmic Terminal command field
PostPosted: Thu Mar 05, 2015 4:52 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Mar 15, 2014
Posts: 115
Location: Brooklyn, NY
Hi orti1980,
Not sure what you are asking. If you prefer entering an arbitrary set of G'MIC commands, free-form style, there is are Gimp-G'MIC filters just for that purpose. See Various -> Custom Code (local or global)

You may enter any number of G'MIC commands in a text box, preview the execution by pressing an update button, then commiting the commands to the active layer when you press OK.

In light of this, it would be somewhat redundant to replicate this on all four hundred or so filters.

Forgive me if I am misunderstanding what you are asking.

Garry


Top
 Post subject: Re: Gimp_Gmic Terminal command output field
PostPosted: Thu Mar 05, 2015 5:00 pm  (#3) 
Offline
GimpChat Member

Joined: Mar 05, 2015
Posts: 5
Why will only the output field show me the command as text


Top
 Post subject: Re: Gimp_Gmic Terminal command output field
PostPosted: Thu Mar 05, 2015 5:11 pm  (#4) 
Offline
GimpChat Member

Joined: Mar 05, 2015
Posts: 5
i edit an image with gimp and with a bash script same gmic command 50 images


Top
 Post subject: Re: Gimp_Gmic Terminal command output field
PostPosted: Thu Mar 05, 2015 6:47 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Mar 15, 2014
Posts: 115
Location: Brooklyn, NY
Hi orti1980,
You can get the command line equivalent of any Gimp-G'MIC filter by starting Gimp in a shell, invoking the G'MIC plug-in and setting its output mode to "Verbose." The form of the command appropriate for a shell would then be echoed in the shell that you started Gimp whenever you use a filter. That is always current and never needs updating, as would an annotation printed on the filter itself. You can then copy this shell output into your own scripts.
Here is a tutorial on how to do this:
The command line behind the Gimp plug-in

Hope this helps.

Garry


Top
 Post subject: Re: Gimp_Gmic Terminal command output field
PostPosted: Thu Mar 05, 2015 7:07 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Alternatively, if you set Gimp-GMIC's "Output mode" to "New layer(s)", the new layer is generated with a name containing the GMIC command that created it, eg:
[G'MIC] Corvo's painting 5 : -gimp_corvo_painting_5 35,10,10,0.5,50,0.3,50,2,5,1


Top
 Post subject: Re: Gimp_Gmic Terminal command output field
PostPosted: Fri Mar 06, 2015 3:20 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Also, in the current beta version of the plug-in, you have an explicit option to force the layer name to be set with the invoked G'MIC command :

Attachment:
gmic_verbose_layer.png
gmic_verbose_layer.png [ 470.49 KiB | Viewed 2931 times ]


Top
 Post subject: Re: Gimp_Gmic Terminal command output field
PostPosted: Fri Mar 06, 2015 10:35 am  (#8) 
Offline
GimpChat Member

Joined: Mar 05, 2015
Posts: 5
thx for answers

and

why is 1 thread faster 16 thread

Cpu= AMD 8 Core

Linux=Fedora 21

gmic with OpenMP


TIME WITH 1 THREAD :

[orti@localhost ~]$ time gmic 1.png -unsharp_octave 4,5,3,0 -o 22.png
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input file '1.png' at position 0 (1 image 1280x720x1x3).
[gmic]-1./ Apply octave sharpening on image [0], with 4 scales, radius 5, amount 3 and threshold 0.
[gmic]-1./ Output image [0] as file '22.png' (1 image 1280x720x1x3).
[gmic]-1./ End G'MIC interpreter.

real 0m1.294s
user 0m1.776s
sys 0m0.115s


thx

TIME WITH 16 THREAD :


-apply_parallel_overlap
[orti@localhost ~]$ time gmic 1.png -apply_parallel_overlap "-unsharp_octave 4,5,3,0",0,nb_threads=16 -o 22.png
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input file '1.png' at position 0 (1 image 1280x720x1x3).
[gmic]-1./ Apply parallelized command '-unsharp_octave 4,5,3,0,0,nb_threads=16' on image [0], with overlap 0 and 8 threads.
[gmic]-1./ Output image [0] as file '22.png' (1 image 1280x720x1x3).
[gmic]-1./ End G'MIC interpreter.

real 0m1.272s
user 0m1.734s
sys 0m0.250s


[orti@localhost ~]$ time gmic 1.png -apply_parallel "-unsharp_octave 4,5,3,0",16 -o 22.png
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input file '1.png' at position 0 (1 image 1280x720x1x3).
[gmic]-1./ Execute command '-unsharp_octave 4,5,3,0,16' on all image [0] in parallel, using 8 threads.
[gmic]-1./ Output image [0] as file '22.png' (1 image 1280x720x1x3).
[gmic]-1./ End G'MIC interpreter.

real 0m1.348s
user 0m1.812s
sys 0m0.154s


-apply_parallel
[orti@localhost ~]$ time gmic 1.png -apply_parallel "-unsharp_octave 4,5,3,0",0,nb_threads=16 -o 22.png
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input file '1.png' at position 0 (1 image 1280x720x1x3).
[gmic]-1./ Execute command '-unsharp_octave 4,5,3,0,0,nb_threads=16' on all image [0] in parallel, 8 threads.
[gmic]-1./ Output image [0] as file '22.png' (1 image 1280x720x1x3).
[gmic]-1./ End G'MIC interpreter.

real 0m1.347s
user 0m1.820s
sys 0m0.128s


Top
 Post subject: Re: Gimp_Gmic Terminal command output field
PostPosted: Fri Mar 06, 2015 1:39 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
@orti1980 : There are several points that explain it:

1. The command '-apply_parallel' applies a command on a list of images in parallel (one thread by image basically). If you have only a single image in your list (which is your case here), this command is useless (it is even slower due to additional code run). I suppose you were thinking about the command '-apply_parallel_overlap' instead ? This one splits an image into several parts and apply the same filter in parallel on each part.

2. Even with '-apply_parallel_overlap', I think the command '-unsharp_octave' command would be actually slower. Because the '-unsharp_octave' command is already based on Open-MP accelerated native commands ('-blur', and arithmetic operators on images), so it already runs in parallel ! Using the '-apply_parallel_...' commands is useful only when single-threaded operators are involved (and this is more and more difficult to find, as I am progressively putting OpenMP directives in the code as the time goes by). Note that these '-apply_parallel..' commands do not use OpenMP, but run multiple threads explicitely (with the pthread library on Linux). So at the end, I'd suggest you just use the command '-unsharp_octave' without trying to parallelize it more. I'm not surprised this is the fastest command actually.

3. Just a note: you didn't invoke the command '-apply_parallel' command correctly. You don't have to write the argument names when invoking a command. And you have to backslash the double quotes if you call it from a shell. So,
-apply_parallel_overlap \"-unsharp_octave 4,5,3,0\",0,16

is correct, but not
-apply_parallel_overlap "-unsharp_octave 4,5,3,0",0,nb_threads=16


Cheers,

David.


Top
 Post subject: Re: Gimp_Gmic Terminal command output field
PostPosted: Sat Mar 07, 2015 9:12 pm  (#10) 
Offline
GimpChat Member

Joined: Mar 05, 2015
Posts: 5
Ronounours wrote:
-apply_parallel_overlap \"-unsharp_octave 4,5,3,0\",0,16



Thank you for your help


Top
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts gmic cli with -output spits out an empty image

2

No new posts Can a python script use gimpfu, run from terminal, and create new img?

2

No new posts Gimp's webp output

1

No new posts Attachment(s) custom font output problems[solved]

2

No new posts Best recommendation for terminal art ("ascii art") from image?

4



* Login  



Powered by phpBB3 © phpBB Group