- 02 Dec, 2018 1 commit
-
-
Ell authored
... it's no longer needed, since GEGL commit gegl@9dcd2cde. Partially reverts commits: 6fca9959 cc10af72 49c53568 8edbc0d4 29f63616 3a201498 ee48ec68 4165a315 76408527 b7633c72 6ab12061 754a3c5b 22b4b647 55b34383 c6d23add f03a84d6 822f9f0d 95358ca1 cdda37f4 41e80356 6761da42 fb5d7832 97ed7817 46e90365 ea9c5e6a 24fbdfb5 beb4ecb2 4b77831e fcf113a3 567ffe94
-
- 29 Nov, 2018 1 commit
-
-
Jehan authored
We can't just hardcode this. On huge images in particular, you'll want to increase this value.
-
- 27 Nov, 2018 1 commit
-
-
Jehan authored
The distance map has all the information we need already. Also we will actually grow up to the max radius pixel (middle pixel of a stroke). After discussing with Aryeom, we realized it was better to fill a stroke fully (for cases of overflowing, I already added the "Maximum growing size" property anyway).
-
- 22 Nov, 2018 3 commits
-
-
Jehan authored
When flooding the line art, we may overflood it in sample merge (which would use color in the line art computation). And if having all colors on the same layer, this would go over other colors (making the wrong impression that the line art leaked). This new option is mostly to keep some control over the mask growth. Usually a few pixels is enough for most styles of drawing (though we could technically allow for very wide strokes).
-
Jehan authored
For this, I needed distmap of the closed version of the line art (after splines and segments are created). This will result in invisible stroke borders added when flooding in the end. These invisible borders will have a thickness of 0.0, which means that flooding will stop at once after these single pixels are filled, which makes it quick, and is perfect since created splines and segments are 1-pixel thick anyway. Only downside is having to run "gegl:distance-transform" a second time, but this still stays fast.
-
Jehan authored
We don't really need to flow every line art pixel and this new implementation is simpler (because we don't actually need over-featured watershedding), and a lot lot faster, making the line art bucket fill now very reactive. For this, I am keeping the computed distance map, as well as local thickness map around to be used when flooding the line art pixels (basically I try to flood half the stroke thickness). Note that there are still some issues with this new implementation as it doesn't properly flood yet created (i.e. invisible) splines and segments, and in particular the ones between 2 colored sections. I am going to fix this next.
-
- 20 Nov, 2018 1 commit
-
-
Jehan authored
This commit is based on GEGL master as I just made the auxiliary buffer of gegl:watershed-transform optional for basic cases. It doesn't necessarily makes the whole operation that much faster according to my tests, but it makes the code simpler as creating this priority map was quite unnecessary.
-
- 19 Nov, 2018 2 commits
-
-
Ell authored
... and use in bucket-fill tool Add gimp_pickable_contiguous_region_prepare_line_art_async(), which computes a line-art asynchronously, and use it in the bucket-fill tool, instead of having the tool create the async op. This allows the async to keep running even after the pickable dies, since we only need the pickable's buffer, and not the pickable itself. Previously, we reffed the pickable for the duration of the async, but we could still segfault when unreffing it, if the pickable was a drawable, and its parent image had already died. Furthermore, let the async work on a copy of the pickable's buffer, rather than the pickable's buffer directly. This avoids some race conditions when the pickable is the image (i.e., when "sample merged" is active), since then we're using image projection's buffer, which is generally unsafe to use in different threads concurrently. Also, s/! has_alpha/has_alpha/ when looking for transparent pixels, and quit early, at least during this stage, if the async in canceled.
-
- 15 Nov, 2018 1 commit
-
-
Jehan authored
-
- 14 Nov, 2018 9 commits
-
-
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
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
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
-
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.
-
- 10 Sep, 2018 1 commit
-
-
Øyvind "pippin" Kolås authored
-
- 21 Jul, 2018 1 commit
-
-
Michael Natterer authored
All babl formats now have a space equivalent to a color profile, determining the format's primaries and TRCs. This commit makes GIMP aware of this. libgimp: - enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA as deprecated aliases, add PERCEPTUAL values so we now have LINEAR, NON_LINEAR and PERCPTUAL for each encoding, matching the babl encoding variants RGB, R'G'B' and R~G~B~. - gimp_color_transform_can_gegl_copy() now returns TRUE if both profiles can return a babl space, increasing the amount of fast babl color conversions significantly. - TODO: no solution yet for getting libgimp drawable proxy buffers in the right format with space. plug-ins: - follow the GimpPrecision change. - TODO: everything else unchanged and partly broken or sub-optimal, like setting a new image's color profile too late. app: - add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as replacement for all "linear" booleans. - change gimp-babl functions to take babl spaces and GimpTRCType parameters and support all sorts of new perceptual ~ formats. - a lot of places changed in the early days of goat invasion didn't take advantage of gimp-babl utility functions and constructed formats manually. They all needed revisiting and many now use much simpler code calling gimp-babl API. - change gimp_babl_format_get_color_profile() to really extract a newly allocated color profile from the format, and add gimp_babl_get_builtin_color_profile() which does the same as gimp_babl_format_get_color_profile() did before. Visited all callers to decide whether they are looking for the format's actual profile, or for one of the builtin profiles, simplifying code that only needs builtin profiles. - drawables have a new get_space_api(), get_linear() is now get_trc(). - images now have a "layer space" and an API to get it, gimp_image_get_layer_format() returns formats in that space. - an image's layer space is created from the image's color profile, change gimpimage-color-profile to deal with that correctly - change many babl_format() calls to babl_format_with_space() and take the space from passed formats or drawables - add function gimp_layer_fix_format_space() which replaces the layer's buffer with one that has the image's layer format, but doesn't change pixel values - use gimp_layer_fix_format_space() to make sure layers loaded from XCF and created by plug-ins have the right space when added to the image, because it's impossible to always assign the right space upon layer creation - "assign color profile" and "discard color profile" now require use of gimp_layer_fix_format_space() too because the profile is now embedded in all formats via the space. Add gimp_image_assign_color_profile() which does all that and call it instead of a simple gimp_image_set_color_profile(), also from the PDB set-color-profile functions, which are essentially "assign" and "discard" calls. - generally, make sure a new image's color profile is set before adding layers to it, gimp_image_set_color_profile() is more than before considered know-what-you-are-doing API. - take special precaution in all places that call gimp_drawable_convert_type(), we now must pass a new_profile from all callers that convert layers within the same image (such as image_convert_type, image_convert_precision), because the layer's new space can't be determined from the image's layer format during the call. - change all "linear" properties to "trc", in all config objects like for levels and curves, in the histogram, in the widgets. This results in some GUI that now has three choices instead of two. TODO: we might want to reduce that back to two later. - keep "linear" boolean properties around as compat if needed for file pasring, but always convert the parsed parsed boolean to GimpTRCType. - TODO: the image's "enable color management" switch is currently broken, will fix that in another commit.
-
- 11 Jul, 2018 1 commit
-
-
- 14 May, 2018 1 commit
-
-
Ell authored
In gimp_pickable_contiguous_region_by_seed(), use gegl_buffer_get() to sample the mask buffer, instead of using a sampler. The sampler is created at the beginning of the operation, and is subsequently used after modifying the mask buffer, which should be avoided, since the sampler may return outdated cached data.
-
- 13 May, 2018 1 commit
-
-
Ell authored
... instead of gegl_buffer_sample() Ditto.
-
- 08 Apr, 2018 1 commit
-
-
luz.paz authored
Found via `codespell -q 3 --skip="./po*"`
-
- 11 May, 2017 1 commit
-
-
Ell authored
babl already has a faster path for getting L only, than going through LCH.
-
- 09 May, 2017 1 commit
-
-
Michael Natterer authored
Add the additional enum values to enum GimpSelectCriterion, and the few needed lines to gimppickable-contiguous-region.c. It's horribly slow, but works.
-
- 22 Sep, 2016 1 commit
-
-
Ell authored
Not as dramatic this time...
-
- 15 Sep, 2016 1 commit
-
-
Ell authored
thru gimp_pickable_contiguous_region_by_seed()
-
- 16 Jan, 2016 1 commit
-
-
Ell authored
...gimp_pickable_contiguous_region_by_seed(), in preperation for adding a similar option to the relevant tools. When this parameter is TRUE, all eight neighbors of each pixel are considered when calculating the resulting region, instead of just the four orthogonal ones. This commit also modifies all callers to pass FALSE for this parameter, to retain the current behavior.
-
- 22 Oct, 2015 1 commit
-
-
David Gowers authored
Implement 'Alpha' criterion for selection tools
-
- 27 Aug, 2014 1 commit
-
-
Michael Natterer authored
gimp_pickable_contiguous_region_by_seed(): don't call find_contiguous_region() with start coords outside the buffer, or it will run into an infinite loop.
-
- 02 Jul, 2014 1 commit
-
-
Michael Natterer authored
-
- 17 Jun, 2014 1 commit
-
-
Michael Natterer authored
GeglSampler is now much faster. Leave the #ifdefs there for the time being for benchmarking purposes.
-
- 12 Jun, 2014 2 commits
-
-
Michael Natterer authored
This maps threshold changes by moving the mouse more uniformly to the growing/shrinking of the selected area, and the tools should work perceptually anyway. Also, it makes things another 10 times as fast on gamma-corrected drawables.
-
Michael Natterer authored
Makes the thing about twice as fast (used by fuzzy select, bucket fill)
-
- 31 May, 2014 1 commit
-
-
Michael Natterer authored
The functions don't need to know about sample_merged, in fact they used the boolean only to either use the passed image or drawable and otherwise ran the same code. The sample_merged logic belongs into their callers (and sometimes not even there).
-
- 13 Sep, 2013 2 commits
-
-
Michael Natterer authored
-
Daniel Sabo authored
The new by-row iteration doesn't re-write the length value for each row. In general it is not safe to modify the iterator data because the internal logic depends on the public data, but this specific case is new.
-
- 23 Jun, 2013 1 commit
-
-
Michael Natterer authored
- Add new enum GimpComponentType which contains u8, u16, u32 etc. - Change GimpPrecision to be u8-linear, u8-gamma, u16-linear etc. - Add all the needed formats to gimp-babl.c - Bump the XCF version to 5 and make sure version 4 with the old GimpPrecision enum values is loaded correctly This change blows up the precision enums in "New Image" and Image->Precision so we can test all this stuff. It is undecided what format will be user-visible options in 2.10.
-