It is currently Tue Aug 11, 2026 6:54 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: gmic and multiple images
PostPosted: Thu May 30, 2013 2:31 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
I read that any gmic function can be applied to multiple images (referred to by numbers), but so far I only noticed references to one original image plus one or more images created inside the function itself.
Is there a way to operate on two (or more) different images loaded from a folder?
Thanks

_________________
"Where am I ?"


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 and multiple images
PostPosted: Thu May 30, 2013 4:56 am  (#2) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
The image stack can take a bit of getting used to, but here are a few examples:

#input two images from files and add a 3rd new one
-input "test1.png"
-input "test2.png"
320,200,1,3,0 # creates a new 320x200 3 channel (for example RGB) image filled with 0 i.e. black

# 3 ways of doing the same thing
-blur 3 # blur ALL images in the stack by 3
-blur[-2,-1] 3 # blur the most recently added and the one previous to it (so the blank and test2.png)
-blur[0,1] 3 # blur the first and second images (test1.png and test2.png)

# merging two images
-blend[0,1] average # blend the first two images into a single image using average mode


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 5:43 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
thanks GC
I didn't explain my doubts clearly; I'm wondering how to "input" images from inside GIMP.
so to refer to your first example: where are test1.png and test2.png stored?
GMIC can be launched inside GIMP only after having opened an image, well, that let's call it test0.png; if I want to open also test1 and test2 (which are inside the same folder of test0) is it enough to call them simply by those names (no path needed?)
Thanks

edit: more specifically: if I put a parameter in the GMIC script ("second image to open") where the user can input the name, may this one be as simple as "test2.png"?)

_________________
"Where am I ?"


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:08 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
All is controlled by the combobox 'Input layers', located on the left, where you can choose :
- 'None' : G'MIC interpreter will be called with an empty list.
- 'Active (default)' : G'MIC interpreter will be called with a list containing a single image (the active layer you are working on).
- 'All' : Interpreter will be called with a list containing all image layers.
- ... and so on...


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:22 am  (#5) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Yes the simplest and preferred way in gimp is by assuming the images are all loaded in gimp as separate layers, then the person using it has to choose from those options on the left - for example Input layers "All".

If you really must select the files from the gmic filter you can use a file browsing button:

#@gimp filetest : gcd_filetest, gcd_filetest(1)
#@gimp : Select Image = file()
#@gimp : sep = separator()
gcd_filetest :
-i "$1" -blend average


This is because gimp doesn't tell gmic the location of the currently open file (by default on windows 7 gmic looks in c:\user\<your profile>\)


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:33 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Ron,
I tried already "all", but it considers only ALL the layers (of the image from which GMIC is called) and not the previous one: that's what I did:
1-start GIMP
2-opened 2 images from a folder (they go on the top list-bar of images in gimp)
3-but only one is obviously (at least for me) displayed at the centre of GIMP panel
4-irrespective of from which one of the two is on the centre panel, calling a GMIC function with "all" as input layers, always applied the result only to the one on the centre
Did I something wrong?
(reply written before GC post, I'll check it now...)

_________________
"Where am I ?"


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:39 am  (#7) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Unfortunately each image opened that way is treated as a separate instance, they have to be imported using "Open as Layers"


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:42 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
@GCD
tried your code, it goes to where I indicate (folder, then image), but says that is unable to recognise a .jpg image; is it something missing?
thanks

_________________
"Where am I ?"


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:45 am  (#9) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Indeed, the list of file types the gimp plugin can read directly is very limited because it assumes you load them using gimp - .jpg is not supported. Gimp's option File > Open as Layers can get around that :)


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:47 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
OK, the solution of opening as layers works, the code is applied to both..
But I'm also interested in the other solution (browse folders...), which types are allowed there?

_________________
"Where am I ?"


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:50 am  (#11) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Hmm I seem to remember only the most basic types, so probably png/bmp? Basically it's a last resort to load that way from the gimp plugin, I've only ever needed to do it once for video processing of large numbers of files.


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 7:54 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
OK,
thanks GCD & Ron for the clear explanations and support, I'll try to "survive" with open as layers... should be enough

_________________
"Where am I ?"


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 8:04 am  (#13) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Once you're used to it that does work out OK, a lot of the "weirdness" in the way the gmic gimp plugin works is due to the gimp interface with external plugins (plus the fact gmic isn't really a plugin it's a whole standalone project, the gimp plugin is just a nice addition).


Top
 Post subject: Re: gmic and multiple images
PostPosted: Thu May 30, 2013 2:16 pm  (#14) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
I think may be confusion between what Gmic -the command line may do, and what the gmic plugin may do, the how to and tutorial on the gmic wiki refer mostly to the first

Gmic as command line tool may load and edit and even save or export most type of images

The plugin not may open and edit only the layers of the active image , for this offer much options but again evrything is limited to the active image
(... as far i know can't even open layers of other images simultaneusly opened in gimp )

Also , about Input/output , for the plugin that can't be modified by a script or filter , instead it is totally depending from user cotrol :

in other word you may say to gmic how to edit the input image(s),
but will remain the user to which layer(s) to edit :
if only the active layer,
or all layers
or all the visible layers,
or all the invisible layers or what else

and how to direct the filter output :
rewriting the active layer
or creating new layers or images

You my suggest a option in a short filter comment(i.e. As it is suggested for gmic merging modes to take care to to have 2 layers , no less no more , as input) but not force or bypass user choice

_________________
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 and multiple images
PostPosted: Thu May 30, 2013 3:04 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
The fact is the plug-in could be compiled with the support of all these file formats, but it is not because :
- Most people won't use these input/output features as the input/output data are transferred though the GIMP API instead of reading files (it's more efficient to do so by the way).
- It would add annoying dependencies to lot of external libraries (libtiff, libjpeg and so on...). And some people already consider that installing the G'MIC plug-in is a pain, so I don't want to be dependent on yet another .dll or .so files :)


Top
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]


cron

* Login  



Powered by phpBB3 © phpBB Group