 Hello, my name is Jonathan David. I will show you some progress that we've done on Gmick and Python especially NumPy support and some progress on integrating Gmick with Blender. I am part of the grek laboratory and I work in Khan in Normandy. So I am colleague of David who wrote Gmick 10 years ago and so let's go further Gmick, you know it. It's basically an image processing framework with 500 filters You can use it on the command line or as plugins for famous software such as Krita, Natron, Gmick and Paint.net There is a good news. There is a funding for one year and it's actually for me since November till next November Okay, so I'll go first on the Python side to show you some Python binding for Gmick For this we have to understand a bit deeper what is Gmick. Gmick is a package. You have to have images with you and it's got a special language for image processing and an interpreter that warms up and around your commands So this is how it works in C++. You just download it, compile it whatever and then include it and you can run commands. What's special about bricks, main bricks that you need image, which build up image lists and then you pass them to the interpreter Python has the same principle for its binding. The binding is written in C around the C++ library And so you pip install it, you import it, then you create an image But you don't need to create a special kind of list just a simple Python list and then you pass it to the interpreter So the support is right now for macOS and Linux Windows will come soon The idea is that you don't have to install or download anything special when you pip install Gmick except on macOS Unfortunately, you need to install LiboMP Gmick is targeting multi-CPU, not GPU and so it also has internet connection to grab new filters It's also possible for Gmick to get access to your camera thanks to OpenCV. It's on the right here Depends if you compile it locally or not So let's go for a first demo Hello This is a demo about Gmick, a thing in Python. I'll show you very simple steps So I just pip install Gmick first Gmick is there, it was in cache but whatever then I will run Python 3 then I will just import Gmick And Gmick actually what Gmick likes for raw data to build images is actually I have the tutorial just side-by-side Struct structure from Python So you can build bytes with it So and I think there is some randomization inside in my example So I just run like this you can see Gmick has some stuff in it Okay, so I just create a random This okay, and I can see what's inside this image Okay, we are good now actually I could display this image now I'm going away from the tutorial I could display And this works well, I think it will work well in on Windows and Linux Windows not ready yet and Mac OS not sure so And here is a random image that I've just built you see it here Okay, now what I want to add some blur before it. So I just do blur and Add some factor for it blur free and we are good Okay, now what happens if we want a list of images We'll just do like this. So my image is in this and do as this Many times I just do it twice up Hope it's correct, and then I can pass it to me Everyone like this. Okay. So it's actually the same blur, but it's a way to show that it's there and the list is here It's actually changed in place That's it for the demo Let's go for a second demo Hi, so far an advanced demo. I will show you this video game which is bound to Czech Republic. This is a Czech beer persona So here it is So that's it for the game. It was just the first level actually it's a brick breaker It's a fork from processing the JS P5.js game That was created long ago by someone else. And so I'll show you actually the background is different for each level So here is what the background look like. It's a basic map And you see actually every time two cities with a flag to tell the story of a boy and a girl who Had difficulties to meet and to build a deep friendship so This is without me effect and this is with me effect. So I check with public kind of friends This is Normandy So you see before and after just simple make filter Okay, it could be much nicer That's it. And now here was the code looks like So actually I use free libraries First is one for geocoding. So I'm not painting anything myself so just addresses the second one is to build a map using the geocoded coordinates and Then I use gimmick on top of this. So you see here import gimmick And so I have lots of filters filling there Like effects and they are being applied for each picture And that's it. You've seen the results And this is the third demo There has been something new in in mic over the last month And it's the export of all filters parameters into a json file. This is what you see here This json file is hosted on gimmick.eu and there is actually a command to generate it And here you can see Top-level categories of filter like animals and then you can go into sub-level categories and see the parameters for the filters and also the default values using default values you can actually Massive test filters for example between several limitations So but what you are doing here you are testing filters between the command-line interface executable and the gimmick library and the result is something like this you have pictures for one filter This picture using one implementation and picture using a second implementation You see it is the same And actually they could be a third implementation It's blender nodes that we have stability across version and we are sure that 500 blender nodes work as needed What's about gimmick and umpire? Okay gimmick now works in python But numpy support is starting. It's not in alpha not yet released So if you are a data scientist, there are things that you must know about gimmick before using numpy So who is this girl on the left? It's grace hopper so First If you want to use numpy with gimmick, you will have to wait till 2.9.1. So it's maybe one month It's okay. It's not it's pretty soon Then there are conversion function from gimmick image to numpy error and the other way around you need to use them first In order to work with your tools and with a gimmick gimmick works exclusively in float 32 bits and In the other leaf format, so what means the interleaved state for example for RGB images Meek is like the bottom order. It groups channels together. So you need permutation for this and Also, numpy is in yellow. It has lots of different tags but gimmick has just one type So there's a need for conversion. Fortunately, numpy provides ass type and You have also special flags in the conversion function from gimmick image to do the D interleaving and interleaving and The last thing to know about gimmick in comparison with numpy is that gimmick works in only up to three dimensions So one D to D 3d and it has for each pixel or voxel up to two billion channels So it's much more than just red green blue. You can have lots of possibilities Very is the numpy demo So I will demonstrate one way conversion of a gimmick image into a numpy and the array and it's displayed in matplotlib Just follow me. I have here a custom build of gimmick Meek Python with this numpy support that is in alpha Stage So I'm importing a few libraries here. It's gimmick the python imaging library below Numpy and matplotlib. What I will do next is I will load a gimmick picture into a list and Display it Sit and here you have the earth And it's in this object in 500 times 500 dimensions Now what I will do is I will convert it into an Numpy array using a gimmick image conversion function named to numpy array and here I have I'm using interleave to tell gimmick to Put RGB channels next to one other for each pixel Because meek does not work like this and then use Casting using as type Into very simple integrals and I will also squeeze the shape why? because My earth is three dimensionals in meek and in real life for other software. It must be two dimensionals so What I will show you is It's a big array like this That shape this is the shape of it Is the same as for meek and we have here eight bits integer What I will do now is I will show it in matplotlib which takes numpy arrays and here we are Hi data scientist. This is a side note just to show you how to make inside a Google collab notepad just to peep install gimmick And you're ready to run just You can import meek and work with the effects What about meek and blender? So there has been already two projects focusing on integrating meek inside blender maybe more And so they are old the first one is blender to meek and actually It's ended up using the Qt widget of gimmick instead of custom python On top of blender 2.7 and it looks like this So no need to patch blender to use this This is the first version so to say and the second version uses mix official Qt widget And this is for video editing effects Right now it's not my turn anymore and there is another project blender custom nodes This one patches blender and so the fork has to be maintained and now it's not maintained anymore And it used to work on Blender 2.79 for Windows only in 64 bits And the focus was on compositing nodes The architecture was really good for using Just a thin overlay of like meek in C here you see that There is a single node type Where you can insert a gimmick expression and then you have a variety of Fields that are actually not always used depending on the filter that you've entered Okay, so now it's time to dream really and to do good stuff that lasts Here are some hopes so meek blender is the plugin that I'm working on It's an add-on actually for Blender 2.8 The goal is to not not to patch Blender at all and It's leveraging meek Python the binding the goal is to yeah expose 500 filters on all OSes And now for Blender demo of the add-on. I don't know for you, but I love flipbooks and I love the work of animation So I was thinking maybe I could use Blender and meek together to have some nice rendering of animations so I'm at the very beginning and What I do is just show you how to install the meek Blender plugin so basically you go to the release sections on the github page and then you click The zip file I've done it already And then you go and pick it up in Blender so I just Yes, I was thinking of using a filter like this engrave You click on meek.eu in the gallery. You have the code to run towards the similar effect So now I head over to Blender and what I have is seeing with two fishes and They are not yet animated, but I just want to show stuff and So let's go to Preferences I want to grab the meek Blender add-on For this I go to install Then grab the add-on See it's quite big. It's 14 megabytes because there are Compiled libraries inside and now I just enable the add-on That's it. What this this is actually a skinnier done despite its weight what it just allows is to Import meek and work with meek. So if I have this script here, I can do add-p and actually it runs Meek Yeah, it's a gen just run Python and meek is imported and this is the meek modus objects What I would like to show you is operators so I've coded this it's made up of four operators and operators are basically actions or macros that you can run in Blender and The render has been done already. I can show you push it to you and The operators each operator that I've coded is tied to a filter. So There aren't many of them And it's basically the code is like this. So this is just to show the render. I'm using a file system file for this that's in memory buffer This is the blur command Meek It's a terror so It looks like this. It's funny This first menu option shows Okay, the render is not done yet. So we just do a render but mind I will make it very small because my computer is very old Okay, okay now I will do something a bit terrible For speed reason 20% let's go F12 Now the render is stored in a buffer named render result here and And now we can I can show you the render. Okay, you know it Except this is a meek window this window And now I Use the other actions I'm pressing alt-ph time blur This is the meek blur on top of the render and here is the Richie The Meek the Richie And now What's next? This is the most interesting for me is engraving This Meek Yeah, and it's super stylish and I don't know any filters apart from meek able to do this so Here's something also interesting Is the operators their innovation you remember there are maybe 500 filters and I've managed to parse that JSON file And to print categories and subcategories or so and it's a lot lot of operators and Filters actually That's it and it does not work. Well, yeah, that's a new ways This is the wish for the UI since the add-on is not in a very advanced state for now So imagine you are in blender You open up menus to add some types of note and you have the meek nodes in two levels of categories And see the dragonfly node With very specific fields you even see commands of the offer here Yeah, so each node would be different for this we need Special type of architecture. I mean we need to think about it pretty much so that it lasts So this is the first idea Is that we shouldn't patch blender or patch a blender should patch itself and Maybe some very light patch and then I have just an add-on which maybe uses meek by the myth Python binding And here are our 500 nodes or so The second idea is to imitate Freestyle freestyle allows to run there with a comic style in blender and it's out of French laboratory for Artificial intelligence and Actually, what they have done is that they have patched blender. So to say our blender has embedded the library Completely and so when you compile blender you compile freestyle in this at the same time it's not a spread fork and They have some Python but Python for in this case is Is embodied in blender? I mean for freestyle for us it could be an add-on actually bundle add-on we don't know So it's nice to dream, but maybe it's also nice to communicate Right now I need time to finish the numpy integration and after then I will get in touch with the blender foundation So I've been on the blender chat already and we can make calls write mails and it crepes together Maybe if it's viral That's an idea, but I hope that we'll have something lasting for good That's it So thank you for following the presentation. Have a nice day. This is my Twitter name if you want to write Bye-bye I am open for a question so there's the first question is What would you recommend to read and learn more about the blender? I must say I do not know the blender API Well enough. I've used it maybe ten years ago and I'm getting back to it so and I also was Mostly focused on the game engine which is not any more in blender 2.8. So I cannot answer Just I would say Design what you want to do Just on pen with pen and paper as the storyboard and then starts coding with a very simple Roadmap so from very bad application very simple to more and more complex and you could go on The blender chat and there is a Python channel for it and just ask your beginner questions. It should be okay and there are no more and more even Video tutorials on coding in Python for Blender, but I'm sorry. I cannot recommend an area to study mostly API Okay. Yeah, it can be shared on Blender nation. I think so now the video is really enough Just that I will focus on numpy first before Blender Advanced Blender support Yeah, okay a question regarding last paint last paint is the graphics software obviously and Yes, you can add Nick support using Python. It should be easy enough and notes for that for since Nick Python is Pure compiled Python module. It means that you need shared libraries that are compiled for you For each operating system, so for Mac OS we have deenleads for Linux We have dot so files and for Windows, I guess we'll have DLL files or something that is compatible with Python and for the as you you must know for the Blender add-on We ship actually we used the same technique as the clip add-on clip. That's used to do liquid simulations We ship all shared libraries for all OSes together in different directories So you just in the install a zip file, but actually it should work on all supported operating systems That's to say right now Just Linux but for that's the case of Blender and we can help in integrating into anything any software Okay So a question at this question sometimes I find interesting results in filter But they produce images that cannot be used as seamless What are the ideas and make about implementing more filters to be used with seamless results? I use these kind of images to produce patterns in Krita But if the result is seamless could be applied also in Blender. I Okay, I'm a bit new to make If you mean texture repeating in order to have tiles that you know you can repeat It's just you need to find the right filters or just I would say right to on pixel s dot us I think Okay, I'm pixel s dot us. It's the forum or right to just make Author or to me I will My name on the chat. This is my my personal image on the chat My self-insert I can be found on Twitter and I can help to maybe Find for you the right filter because there are lots of filter That's okay. Maybe some of them are seamless or maybe a new one could be written for you Okay, can we how can we contact you my email is dropped on The REC Chat or you can contact me on Twitter. My nickname is myself himself all attached No special characters myself himself Okay, if you work with Mac OS, what's your experience building me in Python? Okay in the laboratory we know that building me for a Mac OS is a bit a pain in the ass and We do not use Mac OS ourselves. What I've done to build me for Mac OS is I've used GitHub action actions. It's like Travis Travis CI It's a continuous interaction integration platform what it does is it's It loads Mac OS virtual machine and then you can run any comments there what I'm doing is I'm using LLVM C long version six not something more recent and it manages to reach the McLagbury and the McPyton by Dinkle together and Maybe there is no Quartz support in it. I must say I have not tested this on Mac OS What I have done with the an engineer in Intel microchip in Ireland that for the big lender Adam If I'm not mistaken I We have automated testing also for Mac OS or maybe it's And so Imports me at least works what may not work for Mac OS is this display Instruction display command in the big where you have a pop-up showing With your window manager the picture that you've done Okay question answer. I was hoping that I could ask me supports just like I would do for the Python library like pillow For example, are you saying that is not simple for users to install me for Python? Okay, Nick for Python did not exist before or if it existed most probably The project about it was a wrapper against the commit command line executable. So you had this Nick command that you can around on in bash or batch or whatever in the command line and it's just an executable so and What I've done now is I've created a package that can be people installed from pi pi.org I couldn't share my screen maybe it's better Share my food screen. Okay, I'm sharing my screen This is pi pi.org and If you look for a mix it's there mix there version 2.8 point four this is a project I worked on Blender Adam tester and it tries to test the Nick Blender Adam inside the many versions of Blender, but Yeah, that's the big Python binding it's there and in order to You have the releases here. So the latest that's published is 2.8 point four but it will be soon 2.9 point zero 2.9 point one and The files that you can download here are here. So you have far Mac OS And we those is not there yet and you can also build from source there is the The source is not there, but Maybe it used to be in the former version I'll make sure that the source is there as well That's it and so yeah, that's the GitHub page for a mix The big Python binding Nick hyphen pie It's here and This is the page for the new Blender Adam Which just provides big Python actually as a Blender Adam But it's there in the future you will be able to have notes of hopefully That's it. Now I'm going back to questions So Yeah, I see no more questions Okay, a question. Is there any big Java just wondering how I'm vision making phones to be used by the world Okay, let's say this is nice dream. I do not know and I don't think so I can look on Google for you, but I've not heard about it in the laboratory so let's have a look and And I'd say they could be a big for Java if we wrap to make exit a very Okay, I you my screen is not shared. I would share it again Yeah, I'm just looking on Google if Nick is there for job Yeah, there is something about Nick and jar does it now it's about King. I'm sorry. Oh, yeah and It's very feasible even I'm helping a student to finish our Java Homework, so if you need help for me can jar, please ping me again, and that's the idea is the ass is on the screenshot Okay for mobile phones mobile phones. Yeah, you can embed C++ and mobile phone so it should be possible to marshal the library in jar and Embedded in on several operating systems for mobile phones now And the screen my screens. Okay, I'm still here And back For the chat Okay, so I guess the simpler for me would be to use Nick command line Yeah, and the big command line is I can show it to you also it seems that some people don't know Nick so much So, okay, I'm sharing my screen again This is the nickname so Let's go in my home And I this is you can install it like this on Lennon Linux So Nick it's already installed and Then just to run Nick and you have the official nickname. I need C++ running there. You can run The display Nick lines like this Here you have the earth and run filters on it. It's the blurred earth Okay, but yeah, the command line is wrapping the C++ library and the C++ library can be compiled for many operating systems and wrapped with different bindings for different languages No Okay, I am out of questions now Okay, thank you for having me and Feel free to get in touch with us with the laboratory Thank you. Bye