Commit Graph

42820 Commits

Author SHA1 Message Date
e1c4050617 app: bucket fill tool with a "paint-style" interaction.
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).
2018-11-14 13:37:42 +01:00
a3cda4abbe app: make line art pre-computation in threads.
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.
2018-11-14 13:37:42 +01:00
f246f40494 app: compute line art in advance.
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.
2018-11-14 13:37:42 +01:00
b9de1076ed devel-docs: small update for GEGL buffer leak debugging. 2018-11-14 13:37:42 +01:00
93a49951a0 app: fix line art labellization.
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.
2018-11-14 13:37:42 +01:00
c4ff81540d app: better use GeglBufferIterator!
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.
2018-11-14 13:37:42 +01:00
f02993fb9c app: directly update the mask buffer with gegl_node_blit_buffer().
No need to create a temporary buffer for this.
2018-11-14 13:37:42 +01:00
410c747509 app: create a simple priority map for line art selection flooding.
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!
2018-11-14 13:37:42 +01:00
e905ea7ba2 app: with recent gegl:watershed-transform, no need for intermediate...
... labels buffer.
We can watershed directly the mask buffer being correctly flagged.
This commit relies on merge request gegl!8 being accepted and merged.
2018-11-14 13:37:42 +01:00
0c80f8a718 app: use char array for temporary data (rather than a GEGL buffer).
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.
2018-11-14 13:37:42 +01:00
f975f15ec0 app: use simpler allocated variables.
Allocating double-level arrays is just very inefficient.
2018-11-14 13:37:42 +01:00
f19181dcf8 app: make visited into single-level allocated array. 2018-11-14 13:37:42 +01:00
910d7934f5 app: fix stroke labels in gimp_lineart_estimate_stroke_width().
I must make sure that stroke pixels are labelled 0 and non-stroke other
than 0.
2018-11-14 13:37:42 +01:00
1822ea399a app: use more GeglBufferIterator.
In this case, it makes the code a bit more messy, but hopefully more
efficient.
2018-11-14 13:37:42 +01:00
041a8f1eec app: use GeglBufferIterator rather than gegl_buffer_sample|set(). 2018-11-14 13:37:42 +01:00
fcd038eb16 app: babl types returned by choose_format() must be float! 2018-11-14 13:37:42 +01:00
8502b4e743 app: implement second step for line art selection/filling.
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.
2018-11-14 13:37:42 +01:00
8ed12b1b98 app, libgimpbase: add GIMP_SELECT_CRITERION_LINE_ART selection type.
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.
2018-11-14 13:37:42 +01:00
85e6700aac Help menu: various updates
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.
2018-11-14 09:17:21 +00:00
a2da1cd596 Issue #2489 - Gimp 2.10.8 layer menu text along path
Related #2064 - text along path not working with vertical text.
2018-11-13 11:30:49 +09:00
0c20d2bf55 Update Czech translation 2018-11-13 01:24:39 +03:00
Ell
c0b107531e configure.ac: escape backslash chars in compiler version string
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.
2018-11-11 05:49:09 -05:00
Ell
45fc30caa7 Issue #2473 - Transforming a layer doesn't properly transform its mask
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
2ae823ba2b, 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.
2018-11-11 02:26:29 -05:00
Ell
658d9f3a82 Issue #2470 - Spacing between grid lines does not stay at 1px ...
... 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.
2018-11-10 06:52:06 -05:00
Ell
7ab9ee2686 libgimpwidgets: add GimpSpinButton
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.
2018-11-10 06:48:56 -05:00
Ell
84227fbfec tools: in performance-log-viewer.py, fix "function()" predicate ...
... when not specifying a thread-ID
2018-11-10 02:52:32 -05:00
Ell
c7f1730702 app: in performance logs, add new-lines between variable definitions 2018-11-10 02:52:31 -05:00
Ell
c61138f8f0 tools: add performance-log-coalesce.py to EXTRA_DIST 2018-11-09 02:23:13 -05:00
Ell
662636041c devel-docs: another typo fix in performance-logs.md TOC
:P
2018-11-08 11:00:05 -05:00
Ell
5a077649f9 devel-docs: fix typo in performance-logs.md TOC 2018-11-08 10:17:53 -05:00
ba98b98f58 Issue #2431: After coloring a selection and exporting to PDF, file...
... only shows the color (and nothing else) when "Convert bitmaps to
vector graphics where possible" was set.

This is because gimp_drawable_histogram() only checks selected pixels.
So let's make sure we work on a duplicate of the image so that we can
safely remove the selection before processing the export.

(cherry picked from commit 679e341285)
2018-11-08 15:26:34 +01:00
Ell
49375a3def devel-docs: fix typo in performance-issue screenshot
Gah :)
2018-11-08 05:49:42 -05:00
df4e35a846 Issue #2454: recent libwmf uses pkg-config. 2018-11-08 11:39:30 +01:00
Ell
baa8aadc83 devel-docs: fix typo in performance-logs/Makefile.am 2018-11-08 04:24:48 -05:00
Ell
a75c57f2cd configure.ac: add devel-docs/performance-logs/Makefile
Skipped for now on master, together with the rest of devel-docs/.

Should have been part of fa9161e4f2.
2018-11-08 03:51:11 -05:00
Ell
e3b6c8e877 .gitlab: add "performance" issue template
Add a "performance" issue template, which should be used to report
performance-related issues.
2018-11-08 03:46:44 -05:00
Ell
fa9161e4f2 devel-docs: add performance-logs documentation
Add devel-docs/performance-logs/performance-logs.md, which
describes how to record and view performance logs, and how to
report perofrmance-related issues.
2018-11-08 03:40:53 -05:00
Ell
a29d040db5 app: a few improvements to the GimpBacktrace Linux backend
Blacklist the "threaded-ml" thread, which seems to mask the
backtrace signal.

Improve signal-handler synchronozation, to avoid segfaulting when
giving up on waiting for all threads to handle the signal.
Furthermore, when one or more threads fail to handle the signal in
time, return a GimpBacktrace instance with backtraces for all the
other threads, and with empty backtraces for all the non-responding
threads, instead of returning NULL and leaking the allocated
instance.  Don't blacklist threads that failed to handle the signal
in time, and instead shorten the wait period for handling the
signal, and yield execution during waiting to lower the CPU usage.
2018-11-07 14:26:17 -05:00
Ell
0b2d41635a tools: a few improvements in performance-log-viewer.py
In sample-search predicates, remove the "exclusive" parameter of
the "function()" function, and replace it with optional "id" and
"state" parameters, which limit the match to the call-stacks of
matching threads, as per the "thread()" function.

Sort the backtrace thread-list by thread ID.
2018-11-07 14:26:16 -05:00
Ell
fb95d3b86e tools: in performance-log-expand.py, preserve threads with empty stacks
... which can be present in logs since last commit.
2018-11-07 14:26:16 -05:00
Ell
eec1e1f189 app: a few fixes to performance-log backtrace output
Fix delta-encoding of performance-log backtraces in certain cases,
and distinguish between empty call-stacks and removed threads.
2018-11-07 14:26:15 -05:00
2c4831f90b desktop: update release date.
Still hope for tonight! Will it happen?! :-)
2018-11-07 17:01:40 +01:00
Ell
56920dcdbf app: don't let image component mask affect channel colors
Connect GimpImage's gimp:mask-components node to the layers node
*before* connecting the channels node, so that the image's
component mask doesn't affect the channel colors, as is the case in
2.8.
2018-11-04 13:23:56 -05:00
Ell
963322fdd4 app: avoid allocating empty tempbuf for drawable previews
In gimp_view_renderer_drawable_render(), make sure the preview size
is always at least 1x1.

Fixes commit 8009ea342a.
2018-11-03 04:30:17 -04:00
Ell
21b36cd864 tools: in performance-log-viewer.py, show variable descriptions
In the preformance-log viewer, show instrumentation-variable
descriptions as tooltips for the corresponding treeview rows.
2018-11-03 04:17:49 -04:00
Ell
646208eff0 app: include variable descriptions in performance logs
Include instrumentation-variable descriptions in the var-defs
section of performance logs, so that they can be displayed
alongside their names when viewing the log.
2018-11-03 04:17:48 -04:00
Ell
8009ea342a app: simplify drawable preview rendering
Simplify gimp_view_renderer_drawable_render(), by consolidating
common code paths.  In particular, when rendering the preview as
part of an image, always crop the preview to the bounds of the
image, even when downscaling, to avoid unnecessarily downscaling/
convering cropped-out regions.  We previously only did this when
upscaling the preview by a factor of 2 or more; whatever the reason
for this used to be, it's no longer there.
2018-11-03 04:06:13 -04:00
Ell
0cdbe91e5a Issue #2436 - Crash after downsizing canvas
In gimp_view_renderer_drawable_render(), avoid overflow in preview-
area calculation.  This prevents erroneously setting 'scaling_up'
to FALSE while upscaling the drawable by a very large amount, which
can lead to the creation of a very large GimpTempBuf for the
preview, causing memory allocation to fail.
2018-11-02 21:43:04 -04:00
3dea26b6ee Update Spanish translation 2018-11-02 10:42:22 +00:00
5d319b77bf Issue #2160: Exporting to PCX results in a warped file.
Add line data padding when necessary.
Additionally I realize we should convert to little-endian after checking
the bytesperline oddness (this bug was most likely unnoticed until now
as most desktop proc are little endian now anyway).
2018-11-01 22:22:40 +01:00