- 16 Nov, 2018 3 commits
-
-
Jehan authored
Previous algorithm was relying on strokes of small radius to detect points of interest. In order to work with various sizes of strokes, we were computing an approximate median stroke thickness, then using this median value to erode the binary line art. Unfortunately this was not working that well for very fat strokes, and also it was potentially opening holes in the line art. These holes were usually filled back later during the spline and segment creations. Yet it could not be totally assured, and we had some experience where color filling would leak out of line art zones without any holes from the start (which is the opposite of where this new feature is supposed to go)! This updated code computes instead some radius estimate for every border point of strokes, and the detection of end points uses this information of local thickness. Using local approximation is obviously much more accurate than a single thickness approximation for the whole drawing, while not making the processing slower (in particular since we got rid of the quite expensive erosion step). This fixes the aforementionned issues (i.e. work better with fat strokes and do not create invisible holes in closed lines), and also is not subject to the problem of mistakenly increasing median radius when you color fill in sample merge mode (i.e. using also the color data in the input)! Also it is algorithmically less intensive, which is obviously very good. This new version of the algorithm is a reimplementation in GIMP of new code by Sébastien Fourey and David Tschumperlé, as a result of our many discussions and tests with the previous algorithm. Note that we had various tests, experiments and propositions to try and improve these issues. Skeletonization was evoked, but would have been most likely much slower. Simpler erosion based solely on local radius was also a possibility but it may have created too much noise (skeleton barbs), with high curvature, hence may have created too many new artificial endpoints. This new version also creates more endpoints though (and does not seem to lose any previously detected endpoints), which may be a bit annoying yet acceptable with the new bucket fill stroking interaction. In any case, on simple examples, it seems to do the job quite well.
-
Jehan authored
Other bucket fills are now done as filter until committed, but basic selection fill is still done automatically. So let's make sure the canvas is updated immediately (as it used to be before my changes).
-
-
- 15 Nov, 2018 3 commits
- 14 Nov, 2018 26 commits
-
-
Ell authored
Fix indentation in gimp-parallel.{cc,h}. Remove unused typedefs in gimp-parallel.h. s/Gimp/Gegl/ in function-type cast in gimphistogram.c.
-
Ell authored
-
Ell authored
The parallel_distribute() family of functions has been migrated to GEGL. Remove the gimp_parallel_distribute() functions from gimp-parallel, and replace all uses of these functions with the corresponding gegl_parallel_distrubte() functions.
-
Ell authored
-
Jehan authored
Nothing said what was going to be the order of the page, except by testing. Now there will be an explicit text, which will be automatically updated when checking the "reverse order" box.
-
Jehan authored
-
Jehan authored
I have not added all the options for this new tool yet, but this sets the base. I also added a bit of TODO for several places where we need to make it settable, in particular the fuzzy select tool, but also simply PDB calls (this will need to be a PDB context settings. Maybe also I will want to make some LineArtOptions struct in order not to have infinite list of parameters to functions. And at some point, it may also be worth splitting a bit process with other type of selection/fill (since they barely share any settings anyway). Finally I take the opportunity to document a little more the parameters to gimp_lineart_close(), which can still be improved later (I should have documented these straight away when I re-implemented this all from G'Mic code, as I am a bit fuzzy on some details now and will need to re-understand code).
-
Jehan authored
Rather than just having a click interaction, let's allow to "paint" with the bucket fill. This is very useful for the new "line art" colorization since it tends to over-segment the drawing. Therefore being able to stroke through the canvas (rather than click, up, move, click, etc.) makes the process much simpler. This is also faster since we don't have to recompute the line art while a filling is in-progress. Note that this new behavior is not only for the line art mode, but also any other fill criterion, for which it can also be useful. Last change of behavior as a side effect: it is possible to cancel the tool changes the usual GIMP way (for instance by right clicking when releasing the mouse button).
-
Jehan authored
This makes the speed sensation of the tool much faster as line art can be computed in dead time when you start the tool or when you move the pointer.
-
Jehan authored
Right now, this is mostly meaningless as it is still done sequentially. But I am mostly preparing the field to pre-compute the line art as background thread.
-
Jehan authored
-
Jehan authored
The older labelling based off CImg code was broken (probably because of me, from my port). Anyway I realized what it was trying to do was too generic, which is why we had to fix the result later (labeling all non-stroke pixels as 0, etc.). Instead I just implemented a simpler labelling and only look for stroke regions. It still over-label a bit the painting but a lot less, and is much faster.
-
Jehan authored
I don't actually need to loop through borders first. This is what the abyss policy is for, and I can simply check the iterator position to verify I am within buffer boundaries or not. This simplifies the code a lot.
-
Jehan authored
No need to create a temporary buffer for this.
-
Jehan authored
We actually don't need to compute distance map. I just make the simplest priority map, with 1 any line art pixel and 0 any other pixel (in mask or not), lowest priority being propagated first. And let the flooding begin!
-
Jehan authored
Also use more GeglBufferIterator on input GEGL buffer. Using a char array is much less expensive and accelerated the line erosion a lot! Moving to GeglBufferIterator is not finished, but I do in steps.
-
Jehan authored
Allocating double-level arrays is just very inefficient.
-
Jehan authored
-
Jehan authored
I must make sure that stroke pixels are labelled 0 and non-stroke other than 0.
-
Jehan authored
In this case, it makes the code a bit more messy, but hopefully more efficient.
-
Jehan authored
-
Jehan authored
-
Jehan authored
When filling colors in line arts, you don't want to leave space between the strokes and the color, which usually happen with any of the current selection methods. A "KISS" trick is usually to grow your selection a few pixels before filling (adding an additional step in colorization process), which obviously does not handle all cases (depending on drawing style and stroke size, you may need to grow more or less) as it doesn't take into account actual stroke geometry. Instead, I label the selection and the "rest" differently and leave the pixel strokes unlabelled. Then I let these unlabelled pixels be flooded by the "gegl:watershed-transform" operation. Note that this second step is different from the second step from the GREYC research paper, as they use their own watershed algorithm taking color spots as sources to color the whole image at once. This is a different workflow from the one using bucket fill with a single color source.
-
Jehan authored
This commit implements part of the research paper "A Fast and Efficient Semi-guided Algorithm for Flat Coloring Line-arts" from the GREYC (the people from G'Mic). It is meant to select regions from drawn sketchs in a "smart" way, in particular it tries to close non-perfectly closed regions, which is a common headache for digital painters and colorists. The implementation is not finished as it needs some watersheding as well so that the selected area does not leave "holes" near stroke borders. The research paper proposes a new watersheding algorithm, but I may not have to implement it, as it is more focused on automatic colorization with prepared spots (instead of bucket fill-type interaction). This will be used in particular with the fuzzy select and bucket fill tools. Note that this first version is a bit slow once we get to big images, but I hope to be able to optimize this. Also no options from the algorithm are made available in the GUI yet.
-
Alexandre Prokoudine authored
Commented out the inactive plug-ins registry: no point linking to a dead page. Added links to the roadmap page, main wiki page, and the bug tracker. Placed the link to the bug tracker one level up from '<Image>/Help/GIMP Online' to make it more visible.
-
- 13 Nov, 2018 1 commit
-
-
ONO Yoshio authored
Related #2064 - text along path not working with vertical text.
-
- 12 Nov, 2018 1 commit
-
-
- 11 Nov, 2018 2 commits
-
-
Ell authored
When constructing CC_VERSION, escape backslash characters in the compiler version string, so that they don't get interpreted as escape sequences by the compiler. This is especially important on Windows, where the version string of MinGW may contain backslash characters as part of paths.
-
Ell authored
In gimp_drawable_transform_buffer_affine(), avoid modifying the clipping mode when transforming layer masks, since this function is used (among other things) to transform layer masks together with their layer, in which case they should use the same clipping mode as the layer. This fixes a regression introduced by commit 2ae823ba, causing layer masks to be transformed with a mismatched clipping mode during layer transforms, leading to discrepencies between the transformed layer and the transformed mask. This commit merely reverts the necessary part of above commit, fixing the regression, though note that this code is really up for some serious refactoring: the logic for determining which clipping mode to use when is spread all over the place.
-
- 10 Nov, 2018 4 commits
-
-
Ell authored
... as I would like it to. Use GimpSpinButton, added in the previous commit, in GimpSizeEntry, instead of GtkSpinButton. This avoids updating the spin-buttons' adjustment values when they lose focus, truncating the value if it can't be accurately displayed using the corresponding spin-button's digit count. Since size-entries can have multiple spin-buttons using different units, this prevents the value from changing when entring a value using one unit, and then shifting the focus to, but not changing, another unit.
-
Ell authored
GimpSpinButton is a drop-in replacement for (and a subclass of) GtkSpinButton. Unlike GtkSpinButton, it avoids updating the adjustment value when losing focus, unless the entry text has changed. This prevents accidental loss of precision, when the adjustment value can't be accurately displayed in the entry.
-
Ell authored
... when not specifying a thread-ID
-
Ell authored
-