It is currently Fri Apr 19, 2024 11:05 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Film Emulation filters in command-line
PostPosted: Sun May 29, 2016 8:53 am  (#1) 
Offline
GimpChat Member

Joined: May 29, 2016
Posts: 6
Hi,

I'd use the Film Emulation filters in command-line: gmic.eu/film_emulation/index.shtml

Is it possible to do this directly with gmic (without Gimp)? Should I use the PNG file "Hald-CLUT" of each effect?

Thank you very much!


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: Film Emulation filters in command-line
PostPosted: Sun May 29, 2016 2:12 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Maybe you should take a look at : https://github.com/dtschump/gmic-commun ... mp-plug-in
it explains how to get the G'MIC command line associated to one GIMP filter, so you can apply the film emulation filter once in GIMP,
then copy/paste the G'MIC command to perform batch processing on multiple files.
For instance, if I choose the filter Film emulation / Instant [pro] with preset Fuji FP-100c, and I choose Output messages -> Verbose (layer name), I'll be able to get the G'MIC command line directly in the layer name of the processed image.
After that, I can do exactly the same process on the command line, here for instance with command :
$ gmic input.jpg -gimp_emulate_film_instant_pro 3,1,0,1,0,0,0,0,0 -o output.jpg


Top
 Post subject: Re: Film Emulation filters in command-line
PostPosted: Mon May 30, 2016 2:53 am  (#3) 
Offline
GimpChat Member

Joined: May 29, 2016
Posts: 6
Thank you for all these very clear explanations.

This worked very well in normal command line but when it is executed in such a script file on linux:

<?php
exec('gmic input.jpg -gimp_emulate_film_various 1,1,0,1,0,0,0,0,0 -o output.jpg 2>&1', $outputArray);
print_r($outputArray);
?>


I have this error message :

Array
(
[0] =>
[1] => [gmic] Unable to create resources directory 'gmicrc'.
[2] => [gmic]-0./ Start G'MIC interpreter.
[3] => [gmic]-0./ Input file 'input.png' at position 0 (1 image 707x707x1x4).
[4] => [gmic]-1./gimp_emulate_film_various/*substitute/_gimp_emulate_film_various/ Set status to '60's,60's_faded,60's_faded_alt,black_a(...)alt,vintage_brighter,warm,warm_yellow'.
[5] => [gmic]-1./gimp_emulate_film_various/_gimp_emulate_film/*if/ Input Hald-CLUT with name '60's' and resolution 64.
[6] => [gmic] *** Error in ./gimp_emulate_film_various/_gimp_emulate_film/*if/input_clut/*local/*if/ *** Command '-o': gmic::fopen(): Failed to open file '/gmic/clut_60's.cimgz' with mode 'wb'.
[7] => [gmic] Command '-o' has the following description:
[8] =>
[9] => -o: Equivalent to '-output'.
[10] =>
[11] => -output (+):
[12] =>  [type:]filename,_format_options
[13] =>
[14] => Output selected images as one or several numbered file(s).
[15] => (eq. to '-o').
[16] =>
[17] =>
[18] => Default value: 'format_options'=(undefined).
[19] => 
)


It does not load the file "clut_60's.cimgz". I think it's because he can't create directory 'gmicrc' before.

For information, it work well on Windows.


Top
 Post subject: Re: Film Emulation filters in command-line
PostPosted: Mon May 30, 2016 10:01 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Maybe some additional information to explain the problem.
All the film emulation filters require the file gmic_film_cluts.gmz that contains the color mapping data for all film presets.
This file is usually located in the G'MIC resource folder, which is $HOME/.config/gmic on Linux, and %APPDATA%\gmic on Windows.
I don't know why in your case G'MIC cannot create and access its resource folder, but if the data file cannot be found by G'MIC, then yes,
you have no chances to have a working film emulation filter.


Top
 Post subject: Re: Film Emulation filters in command-line
PostPosted: Tue May 31, 2016 12:40 am  (#5) 
Offline
GimpChat Member

Joined: May 29, 2016
Posts: 6
Thank you for your explanation.

Gmic to be run with the "root" rights in a php script on Linux.

I could fix that by using the utility "sudo":

<?php
exec('sudo gmic input.jpg -gimp_emulate_film_various 1,1,0,1,0,0,0,0,0 -o output.jpg');
?>


Top
 Post subject: Re: Film Emulation filters in command-line
PostPosted: Tue May 31, 2016 1:37 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
It's maybe a bit overkill to run G'MIC as a super-user :)
You may also try to set the environment variable $GMIC_PATH to the path of a custom resource folder, to make it used by G'MIC instead of the default path.


Top
Post new topic Reply to topic  [ 6 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 Gimp style emulation

0



* Login  



Powered by phpBB3 © phpBB Group