It is currently Sun Jul 21, 2024 4:08 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: GMIC Metallic look Filter command line (Solved)
PostPosted: Sun Sep 25, 2011 6:58 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Need help with the command line for the Metallic look filter. (I could not find it among the commmands list)
I have guessed this!

(let*
(
;; Matching variables
(metal (car (gimp-layer-copy inner-bevel-layer TRUE)))

)

;; Add a layer
(gimp-image-add-layer image metal -1)
;(gimp-image-raise-layer-to-top image 3d_bkg)

;; name the layer
(gimp-drawable-set-name metal "Metal")



;; Render Metallic look using G'MIC.
(plug-in-gmic 1 image metal 1
(string-append
"-v - " ; To have a silent output. Remove it to display errors from the G'MIC interpreter on stderr.
"-gimp_Metallic_look 1,0,2"

)
)
)
But wilber says no return value from gmic :gaah

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Last edited by Graechan on Sun Sep 25, 2011 9:31 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: GMIC Metallic look Filter command line
PostPosted: Sun Sep 25, 2011 7:57 pm  (#2) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Graechan to get the command-line command

1 )set Output option of gmic plugin to NEW layer

2)run the filter

3) go to the layer windows, and...copy the NEW layer name !!
(it sounds weird but try !! )

NOTE (usually) the last argument is for the plugin preview,so you should delete it to get the command line equivalent

Maybe you will found this script useful (it is for gimp 2.6 will cause warning in 2.7)
it doesn't do much but is to show how call gmic (plugin) with a script
;;
;;   File        : gmic_in_script.scm
;;                 ( Scheme script for GIMP )
;;
;;   Description : Show how to call G'MIC commands from a GIMP script.
;;                 ( http://gmic.sourceforge.net )
;;
;;   Copyright   : David Tschumperle
;;                 ( http://www.greyc.ensicaen.fr/~dtschump/ )
;;
;;   License     : CeCILL v2.0
;;                 ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html )
;;
;;   This software is governed by the CeCILL  license under French law and
;;   abiding by the rules of distribution of free software.  You can  use,
;;   modify and/ or redistribute the software under the terms of the CeCILL
;;   license as circulated by CEA, CNRS and INRIA at the following URL
;;   "http://www.cecill.info".
;;
;;   As a counterpart to the access to the source code and  rights to copy,
;;   modify and redistribute granted by the license, users are provided only
;;   with a limited warranty  and the software's author,  the holder of the
;;   economic rights,  and the successive licensors  have only  limited
;;   liability.
;;
;;   In this respect, the user's attention is drawn to the risks associated
;;   with loading,  using,  modifying and/or developing or reproducing the
;;   software by the user in light of its specific status of free software,
;;   that may mean  that it is complicated to manipulate,  and  that  also
;;   therefore means  that it is reserved for developers  and  experienced
;;   professionals having in-depth computer knowledge. Users are therefore
;;   encouraged to load and test the software's suitability as regards their
;;   requirements in conditions enabling the security of their systems and/or
;;   data to be ensured and,  more generally, to use and operate it in the
;;   same conditions as regards security.
;;
;;   The fact that you are presently reading this means that you have had
;;   knowledge of the CeCILL license and that you accept its terms.
;;

(define   (script-with-gmic img drawable x y z)

  ;; Start undo group.
  (gimp-image-undo-group-start img)

  (let* (
         (copy-layer (car (gimp-layer-copy drawable TRUE)))
         )

    ;; Add a copy of the layer to the image.
    (gimp-image-add-layer img copy-layer -1)

    ;; Render a 3D mapped cube from the active layer, using G'MIC.
    (plug-in-gmic 1 img drawable 1
                  (string-append
                   "-v - " ; To have a silent output. Remove it to display errors from the G'MIC interpreter on stderr.
                   "-gimp_imageobject3d 1,{w},{h},0.5,"
                   (number->string x) ","
                   (number->string y) ","
                   (number->string z) ",45,0,0,-100,0.5,0.7,4"
                   ))

    ;; Merge two layers together, using the G'MIC 'edges' mode (this layer mode does not exist by default in GIMP).
    (plug-in-gmic 1 img drawable 2 "-v - -compose_edges 1")

    )

  ;; Flush display.
  (gimp-displays-flush)

  ;; End undo group.
  (gimp-image-undo-group-end img)
  )

(script-fu-register "script-with-gmic"
                    _"<Image>/Filters/G'MIC Script test..."
                    "Show how to call G'MIC from a GIMP script"
                    "David Tschumperlé"
                    "David Tschumperlé"
                    "October 2009"
                    "*"
                    SF-IMAGE      "Image"      0
                    SF-DRAWABLE         "Drawable"      0
                    SF-ADJUSTMENT   _"X-Angle"   '(57  0 360  1 2 0 0)
                    SF-ADJUSTMENT   _"Y-Angle"   '(41  0 360  1 2 0 0)
                    SF-ADJUSTMENT   _"Z-Angle"   '(21  0 360  1 2 0 0)
                    )

_________________
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: GMIC Metallic look Filter command line
PostPosted: Sun Sep 25, 2011 8:33 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Many thanks Photocomix, I got this "-gimp_tk_metallic 1,0,2,0" well its no wonder wilbur did not get a return value fron GMIC, my guesses were not close this ha been a very handy tip about setting the gmic output to new layers.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: GMIC Metallic look Filter command line
PostPosted: Sun Sep 25, 2011 9:22 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Image

And it worked perfectly in my new Script as above. :yes

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: GMIC Metallic look Filter command line (Solved)
PostPosted: Mon Sep 26, 2011 4:08 am  (#5) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
I really like that Graechan, the color really stands out against the black and yes PC rocks!

_________________
Image


Top
 Post subject: Re: GMIC Metallic look Filter command line
PostPosted: Mon Sep 26, 2011 5:04 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14715
Location: USA
Graechan wrote:
Image

And it worked perfectly in my new Script as above. :yes

When do we get to play with it? :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: GMIC Metallic look Filter command line (Solved)
PostPosted: Mon Sep 26, 2011 11:30 am  (#7) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
:jumpclap I like the effect

A few suggestion

1) if you are writing a script that will call "Metallic Look" BACKUP the actual version of the filter code
That will solve in case of update of the filter that may break your script (i.e a new option included, and so additional paramether )
The backup will solve because
A) Make easier modify your script to adapt to the GMIC filter update
B) or in case the old version had some cool peculiar effects missed in the new, remain possible include as a "Additional Script"
(obviously the names of the 2 filters must be checked well , ... must be different to avoid conflict

#########################################

Usually or a filter is called with a hardcoded value in not iteractive mode,
or is called in iteractive mode ,to the user the task to figure out the setting.

But here that layer trick may be useful:
suppose that i want to call the "Metallic Look", i may experiment the best setting for
1) Metallic Look -GOLD
2 Metallic Look -SILVER
3)Metallic Look -Copper
.(..and more if you wish)

Recover the setting used with that layer trick

Now i may get a still automatic but more flexible filter that offer the option to chose between 4 different metals

_________________
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 new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts How do you run GIMP from the command line?

1

No new posts Attachment(s) G'MIC> Pattern> Strip command line?

2

No new posts GEGL command line and layer modes?

2

No new posts Calling GIMP Plug-in From Command Line - on Windows

0

No new posts Attachment(s) GEGL CHROME METALLIC TEXT STLYLING FILTER!

19



* Login  



Powered by phpBB3 © phpBB Group