GreycLab / gmic

GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing
Other
66 stars 11 forks source link

Apply Color Presets using command line #23

Closed essembeh closed 7 months ago

essembeh commented 9 months ago

Hi

I've been using Gimp and Gmic plugin for a while now and I'm looking for a way to automatize applying filter to many photos with a shell script.

The filters I want to apply are the "Colors/Color Presets", lets's say for the example "Cinematic Travel/Warm Teal"

Screenshot from 2023-11-16 15-27-32

How can I apply it with a command line, using gmic directly? Is there a way to customize the configuration values (contrast, gamma, hue ...) of the filter ?

Thanks

dtschump commented 7 months ago

image

There is a button Copy command to clipboard that can help you for that. Select your filter, tune your parameters, then press this button. Now you can paste the corresponding G'MIC command in a shell command to apply it on multiple images. In your example, I get:

$ gmic ~/work/img/*.jpg fx_color_presets 4,1,1,1,1,30,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,512,100,0,0,0,0,0,0,2,50,50,"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"
essembeh commented 7 months ago

Hi

Thank you so much @dtschump, I never saw this button until now :) Exactly what I was looking for :+1:

essembeh commented 7 months ago

I think I was too fast closing this issue ...

Unfortunatly @dtschump the command you shared does not work here ... any idea?

$ gmic *.JPG fx_color_presets 4,1,1,1,1,30,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,512,100,0,0,0,0,0,0,2,50,50,"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"
[gmic]./ Start G'MIC interpreter (v.3.3.1).
[gmic]./ Input file 'DSC_5360.JPG' at position 0 (1 image 4288x2848x1x3).
[gmic]./ Input file 'p' at position 1
[gmic]./ *** Error *** Unknown command or filename 'p'; did you mean '%'?
dtschump commented 7 months ago

It seems your issue is not related to the fx_color_presets command. What happen if you replace *.JPG by a single filename ?

essembeh commented 7 months ago

I agree @dtschump

I think it might be a problem from NixOS (my Linux distribution). I found this thread and the problem looks similar.

Let me close this issue since I found a solution for my question :+1: