GIMP Chat http://gimpchat.com/ |
|
How To Run A GMIC Filter On Hundreds Or Thousands Of Layers http://gimpchat.com/viewtopic.php?f=10&t=19008 |
Page 1 of 4 |
Author: | Tas_mania [ Sat Dec 26, 2020 3:24 am ] |
Post subject: | How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
Gimp version 2.10.20 Running G'MIC from Gimp and processing hundreds or thousands of layers (frames) doesn't work. It will lock-up eventually. A useful solution is to run G'MIC from a command line. Instructions are for Linux but the idea will work on Windows. Open a terminal and type 'gmic' If you don't see anything your will have to install it. For ubuntu 'sudo apt install gmic' (about 155Mbs) Next open Gimp > G'MIC and then 'Settings' and change the G'MIC output to 'Very verbose'. This is saved. ![]() Then start Gimp from the command line. Often the command is 'gimp' but for me it is '/GimpAppimage/squashfs-root/./AppRun' Then 'open as layers' in Gimp or open a Gimp xcf file with many layers. Open G'MIC and choose the filter you want to use. Often it will be a smoothing or anti-aliasing filter but all filters (except custom code) work this way. For repairs, select a frame with the most artifacts to use as the preview layer. If changing the frames copy one from the middle of the sequence. It's best practice to copy-out the test layer out of the sequence before you 'Apply' the G'MIC filter. Then it won't be modified twice. When you apply the filter to just one layer go back to the command line (terminal) and look at the G'MIC output. There will be many blocks of text but we are looking for the 'apply' sequence. Here is an example: Code: Select all [gmic_gimp_qt]./apply/ v 3 fx_smooth_anisotropic 60,0.562,0.64,3.1,1.1,0.8,30,2,0,1,4,0,0,24 Insert this command and its parameters into a batch script originally written by David Tschumperlé Code: Select all #!/bin/bash This is where it is inserted into the script: ![]() Save the script and call it something like gmic-filter.sh Make the script executable the same way as installing Gimp plugins. Copy the script into the folder with the frames you want to change. Open a command prompt in the folder and run the script ./gmic-filter.sh It will make a sub folder called 'done' and put the modified frames in that. It will take some time but completes successfully. The scripts can be saved and re-used. Why do this? Video editors are getting better all the time but mostly they don't support hundreds of image filters like G'MIC. I think it's also better to do as much pre-processing as possible. This 100 frame GIF was made from a rotating fractal render of 800 frames smoothed with G'MIC and then processed with G'MIC Continuous droste. ![]() Advanced. Complex G'MIC equations such as 'Conformal Maps' have to be put into inverted commas and have all spaces removed before pasting into the batch script. Code: Select all fx_conformal_maps "0,1,0,((1.1+i*z/6)/(1.04-i*z/6))^6.2,0,0,0,0,0,3,0,0,1024,1024" The script can be changed to only modify odd numbered frames, or all even numbered frames Code: Select all #!/bin/bash Any combination of frames down to 1 in every 10 can be used. Code: Select all for i in *[5].png These altered frames can be copied out of the 'done' folder and used to overwrite the unmodified frames which have the same file name. |
Author: | racer-x [ Sat Dec 26, 2020 6:03 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
Batch Processing an image sequence with G'mic. That's an excellent Idea Tas_mania, thanks for posting the process. I can see many uses for this, example cartoonize a video sequence. |
Author: | rich2005 [ Sat Dec 26, 2020 6:27 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
I know Tas_mania has had problems with BIMP but I have used it with 1000+ files - The one here viewtopic.php?f=15&t=18979#p259085 1200 frames ( 1min 20 secs @ 15 fps - no need for more fps with an animation) BIMP will take a gmic command as "another Gimp procedure" A little easier for Windows users than a command line batch file. |
Author: | MareroQ [ Sat Dec 26, 2020 6:40 am ] | ||
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers | ||
In my opinion, I proposed a simpler method long ago: Actions RPL ![]() You open the images to be processed as layers: 1. You are using the selected filter (for example: GMIC) on one layer in INTERACTIVE mode. ![]() 2. For the remaining layers, use the RUN_WITH_LAST_VALS mode. ![]() ![]() This way you no longer need additional combinations.
|
Author: | racer-x [ Sat Dec 26, 2020 11:48 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
You can also do it within G'mic if you set input layers to "All" and you can set it to export new image also if you want. This took less than a minute to make. ![]() Bimp works well here, just make sure you set "Input Layer Mode" to 1. Attachment: bimp.png [ 77.21 KiB | Viewed 11944 times ] I used your idea to make a Batch Processing script for ffmpeg and it works well. Here it is if anyone is interested. Code: Select all #!/bin/bash |
Author: | racer-x [ Sat Dec 26, 2020 4:54 pm ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
Here's one of my old animations converted using G'mic's "Sketch" filter. It was all done within G'mic and took just a few seconds. Attachment: plane.gif [ 2.89 MiB | Viewed 11915 times ] |
Author: | Tas_mania [ Sat Dec 26, 2020 7:29 pm ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
Interesting comments thanks guys. Hi racer the sketch fighter plane is very nice. GIF-size graphics don't make G'MIC hit it's memory limit. This technique is for videos. I made a jello flying saucer with G'MIC crease. ![]() I think it's possible to make a cubist sitcom from old TV clips ![]() I found G'MIC filters with comma separated values work but ones with equations in brackets don't work from the command line. Maybe they need an escape sequence or maybe they just don't work? |
Author: | racer-x [ Sun Dec 27, 2020 7:31 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
I think it kinda adds a little extra life, maybe retro to my goofy animation. Attachment: goofy2.gif [ 3.64 MiB | Viewed 11859 times ] |
Author: | Tas_mania [ Mon Dec 28, 2020 8:07 pm ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
I did an experiment using the cubist filter on about 500 frames of a TV sitcom. It looks jerky becuase the filter is applied to every frame. Need to reduce and smooth the effect. |
Author: | racer-x [ Tue Dec 29, 2020 5:46 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
Nice experiment, though I think you would've had a more interesting outcome using other filters like "Sketch" or something. Your end result looks like a case of bad low compression artefacts commonly seen on poorly encoded videos of old. The only problem with using these types of filters on video, is the the resulting flicker can sometimes be annoying. It's hard to get a smooth look. |
Author: | rich2005 [ Tue Dec 29, 2020 6:56 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
This one from almost 3 years ago https://youtu.be/jz8MaOXgREQ Using Flowblade editor, which does what you can do manually, unpacks into frames, applies gmic filters, reassembles. What is really needed is a up-to-date frameserver. I occasionally use avisynth but it is old and the filters show their age. |
Author: | racer-x [ Tue Dec 29, 2020 1:16 pm ] | ||
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers | ||
Yeah I used to use Avisynth quite a bit back when I ran Windows. Now that I only run Linux, I just use ffmpeg for the bulk of my filtering/encoding. Occasionally I'll boot my Win10 VM and run Avisynth on a video clip to blend frames to get motion blur on running water and so forth for special effects. Here are a couple of interesting variations on my old Mustang animation.. Attachment: Mustang2b.gif [ 2.17 MiB | Viewed 3515 times ]
|
Author: | Tas_mania [ Tue Dec 29, 2020 4:04 pm ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
I agree the cubist filter looks rough on video ![]() The next one I did worked - Rodilius. I turned it down so it was more contained in the object and it tracked the rotating object perfectly. It's 632 layers with a shot from the Gimp animation window. ![]() This 3d fractal already looked good because the software can do iridescent lighting. ![]() I bleached it first and then applied rodilius using G'MIC from a terminal. Hi Rich, that video looks good and its funny but its an 'overall' effect. I mostly make video components and stack them. Having the 2 people in the room done in flowblade with the room as original or something different would look amazing. BTW - which one are you? ![]() |
Author: | racer-x [ Wed Dec 30, 2020 7:10 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
Here's my Mustang using G'mic's "Blur [Dept-of-Field]" filter applied. Attachment: Mustang-blur.gif [ 1.12 MiB | Viewed 3470 times ] "Rain & Snow" filter applied. Attachment: Mustang-Rain&Snow.gif [ 1.61 MiB | Viewed 3469 times ] "Old Photograph" filter applied. Attachment: Mustang-Old-Photo.gif [ 837.79 KiB | Viewed 3466 times ] |
Author: | Tas_mania [ Wed Dec 30, 2020 6:24 pm ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
![]() I got the old ratrod out of the garage. This time with SamJ's 'Hallucinogen' paint work and the back ground done with LyleJK's 'Painting' filter. I like Lyle's filter on panoramas but it's almost impossible to slow it down in a GIF. I also used the Blur [Dept-of-Field] thanks for the tip ![]() |
Author: | teapot [ Wed Dec 30, 2020 10:35 pm ] | ||
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers | ||
Tas_mania, great idea, thank you for the explanation. I like your various results, the ratrod is looking good. racer-x, Good to see the Mustang back with very cool gmic effects. A first try with the old Beetle:
|
Author: | racer-x [ Thu Dec 31, 2020 5:54 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
The Rat Rod looks great Tas. That Beetle looks awesome teapot, you even got the wheels turning. |
Author: | Tas_mania [ Fri Jan 01, 2021 4:54 am ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
Nice teapot. You've always got a trick up your sleeve. ![]() I like the semi-transparent windows and the wheels are an animation inside an animation. Hope you have a good year in 2021. |
Author: | teapot [ Sat Jan 02, 2021 10:18 pm ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
Thank you racer-x and Tas_mania. I hope you both have a good year in 2021 too. With illustrationlook or psyglass filters: Attachment: carillustrationlook.gif [ 2.24 MiB | Viewed 3331 times ] Attachment: carpsyglass.gif [ 4.38 MiB | Viewed 3331 times ] |
Author: | racer-x [ Sun Jan 03, 2021 1:23 pm ] |
Post subject: | Re: How To Run A GMIC Filter On Hundreds Or Thousands Of Layers |
That's cool teapot. Here's a Vintage style filter. Attachment: Vintage-style.gif [ 1.05 MiB | Viewed 3301 times ] |
Page 1 of 4 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |