The weird exception is because I thought it would be expected for a coder to assume empty string means no name, and therefore only named images are affected.
Now coming to think of it, my solution is to use nested keep. That would target only images that I want affected. Like this:
imgs={$!}
$_persistent
keep_named[$imgs--1]
Also, I been wondering something though I don’t expect much out of it: Would the paper Efficient implementation of the smalltalk-80 system be applicable to G’MIC? JavaScript Core8 use it even though Python and others doesn’t. The paper is about technique used for interpretative language to make it almost as fast as compiled C language.
Here’s another idea for _persistent. Can we have a command that basically adds a image into stored list, and if it already exist, it replaces all of them instead, and they’re based on names? I’m currently working on a solution to work with multiple images and whether these images are kept depends on the conditions applied. I will show a solution when I figure that out.
Think of rep_photomosaic, but rewriting the gui version and using _persistent in it. In there, you have large set of image which is used as base for making smaller images, you have the palette to define colors which then will be used to select smaller image to build up bigger image. So, essentially you have different groups of images in $_persistent to work with if you want to optimize it. That is what I’m planning to do after finishing up my recent work.
A command to convert a image into dynamic image. You can actually do that manually now. This means to append 0,and size of array onto image, and making it into vertical form, then it can be modified within math parser.
Honestly, as this is quite “trivial” to write and useful in only quite a few situations, I’m not sure adding a dedicated command for that is really necessary.
Hmm, yes, agreed it’s trivial. I bookmarked the post anyway.
That being said, there’s something that needs to be said about the clipboard feature in GUI. In my last two GUI filters, it makes no sense to use the clipboard feature as the copied code would not run on anywhere else. _persistent also complicates that issue since other place has no access to _persistent data.
If you were to use the clipboard feature on either Premade Palette or Lavander Binary Map, you’d note why they wouldn’t work. The second one is mainly because of the source code text provided within the GUI code.
Maybe a new command only accessible by the GUI to make custom clipboard code would solve this problem?
This week, I’ve been able to work a lot on the G’MIC source code, and so far, I’m quite happy with the results:
I’ve done some cool optimizations/code cleaning on the G’MIC interpreter code.
I’ve added interesting functions to the math evaluator, and improved the expression parser.
I’ve improved the way image copies are named when performing G’MIC commands.
I’ve slightly improved the integrated neural network library.
I’ve corrected a lot of bugs
I’ve posted binaries for version 3.1.6_pre. Right now, I think we are not so far away from a new release.
Current work in progress:
I’m currently trying to set up a “light” convolutional neural network dedicated to image upsampling (x3 upscale). Today, I’ve started getting non-weird results, so I’m quite confident this is going somewhere. Hopefully, I’ll be able to create a command like upscale_cnn and its associated plug-in filter soon!