7-14-2024: Filtering, filtering (draft)
Filtering, filtering…
In https://artgraphic-dbase.blogspot.com/2024/05/5-28-2024-how-to-make-your-first-image.html
In https://artgraphic-dbase.blogspot.com/2024/06/variant-cover-to-far-sector-draft.html
In https://artgraphic-dbase.blogspot.com/2024/06/6-28-2024-advanced-filters-for.html
In https://artgraphic-dbase.blogspot.com/2024/07/7-14-2024-emboss-filtering-draft.html
Artgraphic-db to quote the graphic novel Torso by Bendis and Andreyko, not about the storytelling, not about the mystery and serial killer awards, but, the artistic choices, serving the atmosphere and the mood of the storytelling and the artworking, and our “filters” topic, not to say that this graphic novel is very likely designed with digital tools and routines that we have tried to cover so far (not saying about color treatment (posterization, control of number of colors and levels, thresholds, cutouts, and use of filters as illustrated by the pages scanned and shown below).
Torso Paperback – July 12, 2022
by Brian Michael Bendis (Author), Marc Andreyko (Author)
Product details ::
Publisher : Dark Horse Books (July 12, 2022)
Language : English
Paperback : 288 pages
ISBN-10 : 1506730256
ISBN-13 : 978-1506730257
Item Weight : 1.48 pounds
Dimensions : 6.67 x 0.6 x 10.18 inches
Best Sellers Rank: #158,420 in Books (See Top 100 in Books)
#247 in Mystery Graphic Novels
#377 in Dark Horse Comics & Graphic Novels
#411 in Serial Killers True Accounts
Just, buy it, or, read it ! (not sponsored)
Summary about the batch methods
Scripts and plug-in’s
This is a post about filters. In addition to the post about embossing.
GEGL-GRAPH (GIMP)
Tutorials and information
GEGL for GIMP
Liam Quin
GEGL part1:
https://barefootliam.blogspot.com/2022/10/gegl-plug-ins-for-gimp-part-one-using.html
GEGL part2:
https://barefootliam.blogspot.com/2022/12/gegl-plug-ins-for-gimp-part-two-gegl.html#google_vignette
GEGL-graph in use: application of the directions given in the post on original picture (a), (b) unchanged directions, (c) directions changed (vignette “Winter” resized).
Code lines correspond to GEGL plug-ins available with gimp v2.10.
GEGL part3:
https://barefootliam.blogspot.com/2023/01/gegl-plug-ins-for-gimp-part-three.html
GEGL to write in c
https://archive.org/search?query=creator%3A%22Scott+Draves+and+the+Electric+Sheep%22
Script-fu in Gimp
https://docs.gimp.org/2.10/en/kinds-of-script-fu.html
Plug-ins (Remember, each plugin needs to be in its own folder with the same name as the plugin.)
https://developer.gimp.org/resource/writing-a-plug-in/
Example of SVG filters in GEGL
Introduction
SVG filters are maintained and developed by W3C consortium, as a tool for the WEB development.
They switch from SVG to other Markup Languages or other tools used for the WEB. They say that, historically, the web needed more styles, so, CSS appeared, and, at the time of writing this post, CSS has been used in SVG as well.
SVG is a Markup Language dialect.
(SCHEME is a LISP dialect.)
The link provided presents filters as presented to a broader audience than Vector Graphics Editor users (like Inkscape users), who use SVG.
I paid attention to some insightful clues about SVG filters like the filter functions, the filter primitives and I have seen some other possible developments with the paragraph DOM interfaces.
Example of Bark Filter (from Inkscape)
In a Vector Graphics Editor, like Inkscape, it has been developed the capability to compose new filers, in the same way that the Bark filter (for instance) was composed (seen on the snip below).
Example of Tinfoil Filter (from Inkscape)
The tinfoil filter which is NOT a ready to use GEGL plug-in, has to be coded, and compiled and integrated (the W3C webpage, link above, shows how the feTurbulence filter primitive was coded in c programming language).
Operations existing as GEGL are (so far) listed on the web page.
Example: Emboss (as discussed in the embossing post)
Scripting with SVG
So, Vector Graphics Editors Developers did a lot about filtering. As for now, an Inkscape v1.3.2 has lots of filters ready to use.
A file like the one linked here, shows how they (these Effect Filters) are written in SVG language. The file is just copy/pasted from my Inkscape v1.3.2 installation.
Thus, let us perform a couple of filterings on a set of images. Just, randomly I have picked up filters from the basis files (also, see how the SVG files were modified, 1. Using a filter block copied/pasted from the basis “filters”; 2. Modifying the image filename, “jelly1.png” and so on)
The result is shown below (don’t forget to export as a png image to remain the filter effect). So, something happened, except for jelly2.
275x180 px jellies and filter effects
I have not scripted, but, it is just a matter of reading SVG files, copy/pasting a filter block for each jelly image, changing the image file name and the filter id applied to the image. I managed to make it manually with a text editor.
Jelly2
The problem with “jelly2” is that the filter uses a primitive feFlood that needs to be modified (so, it is even better with the text editor because the setting does not appear with the user interface).
<feFlood flood-color="rgb(255,255,255)" result="result6" flood-opacity="0" />
Modified to
<feFlood flood-color="rgb(100,150,0)" result="result6" flood-opacity="50" />
Now:
First steps (scripting with GIMP)
In this paragraph, I talk about my first steps with operating an image editor software, which has the capability to run plug-ins, or scripts.
I take as an example the GIMP v2.10 that can be installed on a local desktop. In fact, if I want to run the batch mode, scripts, and so on, the remote solution of/by offidocs is not enough (because pop-ups do not happen).
I got a couple of training readings too, because, running the editor with scripts is not proposed as a basic.
Tutorials
My readings were:
The tutorial about SCHEME (https://www.gimp.org/tutorials/Basic_Scheme/);
The tutorial about BATCH MODE (https://www.gimp.org/tutorials/Basic_Batch/);
I had also in mind other selective readings that I got with the special advanced google search (script-fu site:https://www.gimp.org);
And also, the GIMP help browser, coming along with the installation
Effect
Finally, I came out with the filtered image below, on the right, because I succeeded in running a sharpening effect and a cartoon effect in batch mode (original on the left).
Problems met
During my trials, I had to fix different things, and some are not fixed yet, but, keeping going.
For instance, for me, what is happening is not clear, and maybe I am not clear myself about where to find the image material to handle, and where is the working directory, and where is the current directory.
Command line
As seen on the snip, I have run the effect several times:
Thus, in batch mode, I really stupidly ran the following command at the prompt:
D:\GIMPPortable\App\gimp\share\gimp\2.0\scripts>
D:\GIMPPortable\App\gimp\bin\gimp-2.10 -i -b '(mysimple-cartoon 5.0 0.5)' -b '(gimp-quit 0)'
Which consists of setting the current directory to the directory where to find the image (in my case “tiger.PNG”, which is, in my case, in the directory “D:\GIMPPortable\App\gimp\share\gimp\2.0\scripts”, where the script is as well);
In my case, the SCHEME file containing the command “mysimple-cartoon” is called MyCartoonExample.scm;
I gave also the full path to the bin executable, just in case, but, in fact, I needed to do it like that: D:\GIMPPortable\App\gimp\bin\gimp-2.10
The cartoon plug-in is in the plug-in’s: OK
It is said in the GIMP help, that the program runs all scripts, or plug-in’s as scripts. So, I had this idea to call this cartoon effect (which is a plug-in) in a script.
That’s definitely true, the plug-in “cartoon” is in a directory “cartoon”, even in my “portable” configuration on my USB (like in the preferences).
My script-fu is added to the menu
Because I have registered my script-fu (the script calling the cartoon plug-in) I have been able to make it visible in the menu.
Still to define image and drawable in the script-fu console
This snip illustrates the finding of my own script-fu and the plug-in-cartoon, seen as a script, as said, and the parameters needed including run-mode, image and drawable).
In fact, the scheme file shows how I have used a turn-around to find the image file in batch mode, which did not work, surprisingly, with the script-fu console.
Link to Document
Comments
Post a Comment