It is currently Mon Jul 22, 2024 6:21 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Newbie needs help
PostPosted: Mon Feb 24, 2014 7:38 pm  (#1) 
Offline
GimpChat Member

Joined: Feb 24, 2014
Posts: 5
Not sure if this is the right place to post this, but here goes:

What I'm trying to do is batch process the following operations:
1. open a file
2. make a new layer from visible
3. run the G'MIC wild cartoonizer plugin
4. change the layer opacity
5. save the GIMP file
6. export as jpeg

I looked at using the BIMP plugin but ran into a roadblock: I need to specify the G'MIC command string. I tried to set the output messages to logfile or console, but for the life of me I can't figure out where the logfile is saved or how to open the console.

Any help would be greatly appreciated.


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: Newbie needs help
PostPosted: Mon Feb 24, 2014 11:13 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
if you are writing a script to do this the GMIC command string is easy to do,
first run wild-cartoonizer on an image and do the settings as required
set output to new-layer and run
when GMIC finishes you will have a new layer named with the settings you need
and below is an example how to set up for the GMIC plugin to run for smooth-bilateral

(let*
            (
               ;; Matching variables
               (smooth-layer (car (gimp-layer-copy image-layer TRUE)))                   
            )
      
            ;; Add a layer
            (gimp-image-add-layer image smooth-layer -1)
                               
                     
            ;; name the layer
            (gimp-drawable-set-name smooth-layer "Smooth bilateral")

                                 
                  
            ;; Render Smooth bilateral using G'MIC.
            (plug-in-gmic 1 image smooth-layer 1
               (string-append
                  "-v - " ; To have a silent output. Remove it to display errors from the G'MIC interpreter on stderr.
                  "-gimp_bilateral 25,20,2,0,0"
                                 
               )
            )      


         
            ) ;endlet

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


Top
 Post subject: Re: Newbie needs help
PostPosted: Tue Feb 25, 2014 5:24 pm  (#3) 
Offline
GimpChat Member

Joined: Feb 24, 2014
Posts: 5
When I run the Bimp manupulation action: Other GIMP Procedure / plug-in-gmic with the G'mic command string
[G'MIC] Wild cartoonizer : -gimp_m_l_unsharp2 12,2.18,0.3,1.5,1,0.5,0,0.5,0.8,1.28,0 (which I got from the G'mic generated layer name)
I get the following error:

GIMP Error
Plug-in crashed: "gmic_gimp.exe"
(C:\Users\gordonwaddington\.gimp-2.8\plug-ins\gmic_gimp.exe)

The dying plug-in may have messed up GIMP's internal state. You may want to save your images and restart GIMP to be on the safe side.

GIMP Error
Calling error for procedure 'plug-in-gmic':
Procedure 'plug-in-gmic' returned no return values

Any ideas?


Top
 Post subject: Re: Newbie needs help
PostPosted: Wed Feb 26, 2014 1:12 am  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
It tested OK for me
Image
1/ input layer mode 1
2/ command string -gimp_m_l_unsharp2 12,2.18,0.3,1.5,1,0.5,0,0.5,0.8,1.28,0

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


Top
 Post subject: Re: Newbie needs help
PostPosted: Wed Feb 26, 2014 3:03 pm  (#5) 
Offline
GimpChat Member

Joined: Feb 24, 2014
Posts: 5
Thanks, I didn't realize I had to remove the '[G'MIC] Wild cartoonizer :' part.

Is there any way to work with layers in Bimp? I'm not seeing anything.


Top
 Post subject: Re: Newbie needs help
PostPosted: Wed Feb 26, 2014 6:30 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Try File>Export Layers to a folder then use BIMP on the exported layers and after use File>Open as Layers all the layers you saved in the folder

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


Top
 Post subject: Re: Newbie needs help
PostPosted: Tue Mar 04, 2014 8:17 pm  (#7) 
Offline
GimpChat Member

Joined: Feb 24, 2014
Posts: 5
I've got my script to run from the filters menu:


(script-fu-register
"script-fu-cartoonize-interior-photo" ;func name
"Cartoonize Interior Photo" ;menu label
"Cartoonize Interior Photo" ;description
"Gordon Waddington" ;author
"Copyright 2014, Gordon Waddington" ;copyright notice
"March 2, 2014" ;date created
"*" ;image type that the script works on
SF-IMAGE "Input image" 0
SF-DRAWABLE "Input drawable" 0
)
(script-fu-menu-register "script-fu-cartoonize-interior-photo" "<Image>/Filters/Focus360")

(define (script-fu-cartoonize-interior-photo image drawable)

(let* ( )

; Prep
(gimp-context-push)
(gimp-image-undo-group-start image)

; Actual work here

; Duplicate Layer
(gimp-image-insert-layer image (car (gimp-layer-copy (car (gimp-image-get-active-layer image)) FALSE)) 0 0)

; Rename Layer
(gimp-layer-set-name (car (gimp-image-get-active-layer image)) "cartoonized1")

; G'MIC Wild Cartoonizer
(plug-in-gmic RUN-NONINTERACTIVE image drawable 1 "-gimp_m_l_unsharp2 12,2,0.4,1.5,1,0.5,1,1,0.8,1.28,0")

; Change Opacity
(gimp-layer-set-opacity (car (gimp-image-get-active-layer image)) 50)

; Finishing Off
(gimp-image-undo-group-end image)
(gimp-context-pop)
(gimp-displays-flush)
)
)


I created another function which calls script-fu-cartoonize-interior-photo.scm:

(define (cartoonize-interior-photo filename)
(let* (
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image))) )
(script-fu-cartoonize-interior-photo image drawable)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)
)
)


When I type:

"C:\Program Files\GIMP 2\bin\gimp-2.8.exe" -i -b "(cartoonize-interior-photo \"test.tif\")" -b "(gimp-quit 0)"

at the command line, it runs everything except the G'MIC function. If I insert "(gimp-convert-grayscale image)" into script-fu-cartoonize-interior-photo.scm, the saved file is converted to grayscale, but the G'MIC part doesn't happen. Is there something different I need to do when calling from another script?


Top
 Post subject: Re: Newbie needs help
PostPosted: Fri Mar 07, 2014 5:07 pm  (#8) 
Offline
GimpChat Member

Joined: Feb 24, 2014
Posts: 5
I figured out what was going on - GMIC was running but I was saving from the wrong layer.

I changed:
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)

to:
(gimp-image-flatten image)
(gimp-file-save RUN-NONINTERACTIVE image (car (gimp-image-get-active-layer image)) filename filename)


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Script writer newbie

3

No new posts GIMP newbie with problems

3

No new posts Newbie alert: loading numbered files for G'MIC transformation

5

No new posts Attachment(s) GIMP newbie, trying to create a fuzzy border on a gif with 383 frames

2



* Login  



Powered by phpBB3 © phpBB Group