It is currently Sat Jul 20, 2024 6:27 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: g'mic progress bar ...
PostPosted: Tue Oct 28, 2014 10:47 am  (#1) 
Offline
GimpChat Member

Joined: Oct 11, 2014
Posts: 82
in my python script when execute:
pdb.plug_in_gmic(timg, (timg.layers[0]), 2, "-gimp_LCE 80,0.5,0.5,0.5,3,0")

i can see a progress bar:
Attachment:
progress.jpg
progress.jpg [ 39.65 KiB | Viewed 2757 times ]


instead with the code, eg:
pdb.plug_in_gmic(timg, (timg.layers[0]), 2, "-apply_parallel \"-to_rgb --gimp_gradient_norm[0] 0,1.5,0,50.38,1,0 [0] -smooth 8,0.2,1,3,3 -b 0.8 -sharpen 450 [0] -r[0] 20,20,1,3,2 -equalize[0] 256,0%,98% -index[3] [0],1,1 -rm[0] -rv[0,1]  -blend[0,1] multiply,1 -normalize[0] 5,250 -autoindex[0] 21,0.1 -rv[0,1] -blend[0,1] value,1 \" ")

there is no progress bar.

I had a look at -gimp_LCE code but does not seem to have any reference to the progress bar.

Can I have a progress bar also in my custom code? How?
thanks.

console log:
[gmic]-18./ Start G'MIC interpreter.
[gmic]-18./gimp_LCE/apply_channels/ Apply command '-_gimp_LCE 80,0.5,0.5,0.5' on luminance Y of images [0,1,2,..,15,16,17].
[gmic]-18./ End G'MIC interpreter.
[gmic]-18./ Start G'MIC interpreter.
[gmic]-18./ Execute command '-apply_gamma[0] 1.2 -cut[0] 0.0,200.0 -normalize[0] 0,255 -split[0] c -apply_gamma[0] 0.9 -apply_gamma[1] 1.0 -apply_gamma[2] 1.0 -append[0,1,2] c -bilateral 1.2,1.2' on all images [0,1,2,..,15,16,17] in parallel, using 4 threads.
[gmic]-18./ End G'MIC interpreter.
[gmic]-18./ Start G'MIC interpreter.
[gmic]-18./ Execute command '-to_rgb --gimp_gradient_norm[0] 0,1.5,0,50.38,1,0 [0] -smooth 8,0.2,1,3,3 -b 0.8 -sharpen 450 [0] -r[0] 20,20,1,3,2 -equalize[0] 256,0%,98% -index[3] [0],1,1 -rm[0] -rv[0,1]  -blend[0,1] multiply,1 -normalize[0] 5,250 -autoindex[0] 21,0.1 -rv[0,1] -blend[0,1] value,1 ' on all images [0,1,2,..,15,16,17] in parallel, using 4 threads.
[gmic]-18./ End G'MIC interpreter


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: g'mic progress bar ...
PostPosted: Tue Oct 28, 2014 11:21 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Command '-progress' must be used to set the progress bar value :

Quote:
-progress (+):
0<=value<=100 |
-1

Set the progress indice of the current processing pipeline.
This command is useful only when G'MIC is used by an embedding application.


Top
 Post subject: Re: g'mic progress bar ...
PostPosted: Tue Oct 28, 2014 11:32 am  (#3) 
Offline
GimpChat Member

Joined: Oct 11, 2014
Posts: 82
Ronounours wrote:
Command '-progress' must be used to set the progress bar value :

Quote:
-progress (+):
0<=value<=100 |
-1

Set the progress indice of the current processing pipeline.
This command is useful only when G'MIC is used by an embedding application.


Thanks for the reply.
I saw the command -progress, but I have no idea how to use it.
I tried:
pdb.plug_in_gmic(timg, (timg.layers[0]), 2, "-progress 0 -apply_parallel \"-to_rgb --gimp_gradient_norm[0] 0,1.5,0,50.38,1,0 [0] -smooth 8,0.2,1,3,3 -b 0.8 -sharpen 450 [0] -r[0] 20,20,1,3,2 -equalize[0] 256,0%,98% -index[3] [0],1,1 -rm[0] -rv[0,1]  -blend[0,1] multiply,1 -normalize[0] 5,250 -autoindex[0] 21,0.1 -rv[0,1] -blend[0,1] value,1 \" -progress 100")

but nothing happens ...
Some help?


Top
 Post subject: Re: g'mic progress bar ...
PostPosted: Tue Oct 28, 2014 3:38 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
You must set the intermediate values for the progress bar as well.
If you set only the values 0 and 100 you will hardly see something.


Top
 Post subject: Re: g'mic progress bar ...
PostPosted: Thu Oct 30, 2014 6:42 am  (#5) 
Offline
GimpChat Member

Joined: Oct 11, 2014
Posts: 82
ok, with loop, code like this work:

opac=0.5
-to_rgb

-repeat @# -l[$>]
   count={($>+1)} # how to get the total number of image ...
                  # in gimp plugin with all layers input?
-endl -done

-repeat @# -l[$>]
   pc={($>+1)/$count*100}
   -progress $pc
   [0]
   -b[0] 1
   -negative[0]
   -luminance[0]
   -rv[0,1]
   -blend[0,1] overlay,$opac
   -denoise 2,2
-endl -done


but without repeat/loop and using -apply_parallel (much much faster),
it seems there is no way ...


Top
 Post subject: Re: g'mic progress bar ...
PostPosted: Thu Oct 30, 2014 8:15 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
But if your have commands running in parallel, the time spend will be given by the longest thread to execute, which can be a bit hard to determine automatically.
Determining the proper values for a progress bar for any kind of process is a very tough problem anyway.
I doubt there is a simple solution that can be found when running things in parallel, other than just observing the time it takes in the global process, and set the progress values according to this before/after running the parallel computations.


Top
 Post subject: Re: g'mic progress bar ...
PostPosted: Thu Oct 30, 2014 9:33 am  (#7) 
Offline
GimpChat Member

Joined: Oct 11, 2014
Posts: 82
A real case.
An image with 30 layers (frames of a video).

Execution of a single complex command, in parallel on all layers, like:

[gmic]-18./ Execute command '-apply_gamma[0] 1.2 -cut[0] 0.0,200.0 -normalize[0] 0,255 -split[0] c -apply_gamma[0] 0.9 -apply_gamma[1] 1.0 -apply_gamma[2] 1.0 -append[0,1,2] c -bilateral 1.2,1.2' on all images [0,1,2,..,27,28,29] in parallel, using 4 threads.

There is no way to know what layer number are running at the moment,
and set the progress to:
{layer_running_now/total_number_of_layers*100}
in any way?

At least it would be a visible progress for each layer finished.

Thanks for your patience.


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Still Too Lost to make any progress

16



* Login  



Powered by phpBB3 © phpBB Group