Montage combined with Faded array for 20 different images - How?

@dywen Welcome to the forum! Could you provide a small visual example of what you have in mind?

As it are kids photo’s I did a “simulation” with the default cat Array image. I hope you get it :smiley: arrays_cat_full_4-1
So, in this case 8 different images should “spread out”. My idea was to open the 8 images as layers and that then they are arranged in this or a similar way. At the moment I’m manually cropping their heads in circles as the images sometimes have very bad lighting, taken with a crappy camera…

1 Like

I really enjoy this simulation.

I had fun making it!!! :crazy_face: :star_struck: :star_struck: :metal:

Which is why an example is important. My question is whether this is what you are looking for or what you have come up with so far. (In the OP, you mentioned fading and rotation: what do you mean by that?) If this is the latter case, please draw a mock up of what you are hoping to achieve.

In any case, it doesn’t appear you would like to do a traditional class portrait montage.

Hi,
Good questions. It all becomes clearer working on it (in the evening, when the lovely four year old sleeps and you are too t/w/ired to work as there are still some C19 measures going on in your country).

I’m looking for several things:

  • automation to do this (because it resizes, blurs the edges and makes a pattern humans would have trouble with generating)
    I want to do this four two classes of kids → that means 2 times 23 children
  • other versions if automation with a certain playfulness and sillyness creating patterns, but keeping all sizes equal (no child should be bigger than another one)
  • more serious automation for generating a “classic class picture” of 2 times 23 children
    I think full body, with very different backgrounds and sometimes bad quality images

For the moment, I’m cropping their lovely little heads by hand in Gimp, with the ellipse tool, adding an alpha channel for transparancy.

Cat → represents child’s headcat_full_4

Now that the problem is clearly explained I am sure the community can help you.

… … … . … radio/forumsilence… . . . . . …

Now, I realized you are the OP. The effect you want is possible, and while I cannot script due to issues, I’ll tell you a pseudocode.

  1. Create edge fade within pictures.
  2. Connect each pictures by the edge. You need to find how to make it seamless. The shift is evidently dependent on column number.
  3. Blend each pictures.

Thanks @Reptorian.

@dywen People respond when they can or want to: no need to bump.

Depending on the number of portraits, the bottom right corner might have a few blank positions; in which case, you may do some creative shifting of rows as class portrait sets tend to do. The code is the general approach. Modify at your leisure. The first part repeat 9 sample portrait{$^>+1},400 done is merely used to input sample images.

gmic repeat 9 sample portrait{$>+1},400 done +gaussian. 25%,35% * [-1] remove. append_tiles 0 output montage.png

Edit The forum won’t let me insert a new sample image. Adding cut. 0,40% after +gaussian. 25%,35% would make the faces clearer. Highly recommended. In addition, since the faces are lower in this example (or rather, some folks have longer faces and pointier chins), perhaps we should lower the oval mask a bit (for some of them) as well.

1 Like

Close. All one need to do is create a copy of that, apply alpha threshold where every alpha value less than max alpha becomes zero, solidify the background, and them blend the background. I think the OP can figure this out.

Hi, yes I know about forum speeds and generally am a patient person, however, school ends on Tuesday and it already took me more than 2 weeks to get all the images and a colour coded spreadsheet… :sweat:
So, great thanks in taking this up :+1:

I may make a filter for the plugin later.

Instructions Below is sample code. To use it, replace 9 sample portrait{$>+1},400 with $! and specify your inputs before repeat. Hint .49 is radius size and 230,255,230 background colour.

gmic repeat 9 sample portrait{$>+1},400 local[$>] +fill. 1 +circle. 50%,50%,{min(w,h)*.49} normalize[0,1] 0,255 -[1] 1 blend_fade[0,1] . keep[0] endlocal done append_tiles 0 replace_color 0,0,-1,-1,-1,230,255,230 output montage-2.png

1 Like

Nice result!
→ So I run the following in the terminal?
gmic 23 repeat !$ local[$^>] +fill. 1 +circle. 50%,50%,{min(w,h)*.49} normalize 0,255 -[1] 1 blend_fade[0,1] . keep[0] endlocal done append_tiles 0 replace_color 0,0,-1,-1,-1,230,255,230 output montage-2.png

→ This gives me bash: syntax error near unexpected token ('`
hmmm

The reason for your error is that you have two typos in your command line.

1 !$ should be $!.

2 Since you use bash, you shouldn’t be using the Windows ^ escape. Change local[$^>] to local[$>]. I edited my previous post but you didn’t catch it.

Bonus If your images are in the same format or from the same location, you may use input_glob to input them; e.g. input_glob *.jpg to input all the JPGs from your current directory. Of course, there is more to globbing than that.

People are busy. I tend to give fairly complete help but I haven’t had the time or energy recently.

1 Like

@dywen I don’t know how you have set up your notifications. Just wanted to let you know that I have made some edits to my previous posts, which you may or may not have caught. Kindly read them again.

Good luck.

1 Like

Hi, afre,

Thanks for following this up, I really appreciate this. Gmic is new for me and differs from Imagemagick, the tool I’ve been using for on my part modest batch image processing.
I can’t answer fast during the weekend, because, that’s play time, thus 4-your olds say :partying_face:

I still get the syntax error:

gmic 23 repeat ! local[>] +fill. 1 +circle. 50%,50%,{min(w,h)*.49} normalize 0,255 -[1] 1 blend_fade[0,1] . keep[0] endlocal done append_tiles 0 replace_color 0,0,-1,-1,-1,230,255,230 output montage-2.png
bash: syntax error near unexpected token `(’

Which is weird, because there is no ` and only one (
Que pasa?

And take your time, I have been doing a truckload of manual processing in the meantime - but I find this interesting to untangle! Food for futures.
Cheers!
Dywen
(back to being a pirate)

It may have to do with bash. I don’t have a Linux up and running, so I can’t check for you. One workaround is to make a command and save it in a *.gmic file. E.g.

It doesn’t have to be user.gmic. Could be any *.gmic as long as you insert it, just as you insert image files. E.g., gmic foo.gmic [...].

A procedure for Gimp. A bit of preparation required before applying gmic montage.

Some white / transparent edges. These come from my collection of edge-mask. White could be recoloured in gmic if required.
A very flakey script, sg-shuffle-layers.scm to radomise the layer order. I does work but also throws up error message.
A plugin, shuffle-and-merge-files.py to combine a layer stack of edges with a layer stack of portraits.

For those interested zipped on dropbox
Dropbox - File Deleted - Simplify your life about 8 MB

A quick demo: 2 minutes

https://youtu.be/hPDEeiZpUdE

1 Like

The CLI command afre_portraitmontage and its GUI counterpart Portrait Montage (afre's G'MIC diary - #166 by afre) have been committed. Wait a hour or so to update your commands and filters.

1 Like