Commit graph

53740 commits

Author SHA1 Message Date
Yuri Chornoivan
fdd4eabbe0 Update Ukrainian translation 2024-12-20 20:17:07 +00:00
Thomas Manni
c346838043 actions: Set NDE filter before initialization
Filters with custom dialogues like Curves and Levels did not
have the existing filter set before being initialized. This meant
that if you have a different layer selected, editing an existing
filter would add a new filter to your selected layer rather than
editing the filter on its own layer.
This patch sets the NDE filter in the tool before initialization,
so that it can get the correct layer to edit and update the
filter settings on that one.
2024-12-20 16:54:36 +00:00
Kolbjørn Stuestøl
45b0b64036 Update Norwegian Nynorsk translation 2024-12-20 16:40:35 +00:00
Anders Jonsson
623400447b Update Swedish translation 2024-12-20 12:31:46 +00:00
Bruno
350c24cc8a
build/linux: Possibly fix AppImage custom App ID still not working
Following 522b9ced
2024-12-20 08:39:03 -03:00
Luming Zh
d493e36cb0 Update Chinese (China) translation 2024-12-20 10:24:52 +00:00
Martin
454b7ef64f Update Slovenian translation 2024-12-20 06:19:39 +00:00
Ekaterine Papava
9697c5fcb5 Update Georgian translation 2024-12-20 04:39:04 +00:00
Jehan
34dfd6773e gimp-data: improve the script to generate images for the Windows installer. 2024-12-20 01:52:50 +01:00
Anders Jonsson
a3b52c3d4b po: update POTFILES.in 2024-12-20 00:00:35 +00:00
Jehan
d791ff0539 NEWS: update. 2024-12-20 00:45:57 +01:00
Jehan
0a47c59a26 app: some updates regarding MR !1996.
1. After discussions on IRC, we agreed that "A new perceptual blending
   space was added in GIMP 3.0" was a nicer reason to display for
   bumping the XCF version, because instead of focusing on fixes, we
   focus on the new feature (a real "perceptual blending space" was
   added for modes) and also because naming "perceptual" in some form
   seems more helpful for people to figure out what is different.
2. Fixing sensitivity of the non-linear (formerly named perceptual)
   actions when the blend or composite spaces are mutable.
2024-12-19 23:23:50 +01:00
Øyvind Kolås
3f3b29ba12 app, libgimp, pdb: fix perceptual blend space for linear TRC ICC profiles
In previous versions what has been stored/specified as perceptual blending or
compositing spaces has really been the non-linear variant of the images babl
space.

To maintain loading of old files, the code has been updated to actually mean
non-linear and a new perceptual value has been added to the GimpLayerColorSpace
enum, while preserving all old enum values.

This change bumps XCF file version to 23
2024-12-19 23:23:50 +01:00
Marco Ciampa
c380d289eb Update Italian translation 2024-12-19 19:15:24 +00:00
Marco Ciampa
10ac1d1edb Update Italian translation 2024-12-19 19:15:07 +00:00
Marco Ciampa
5a6998d350 Update Italian translation 2024-12-19 19:14:55 +00:00
Alx Sa
7bcc23ec05 tools, widgets: Fix NDE restrictions when different layer selected
As noted by Thomas Manni, editing NDE filters was still affected by
restrictions on existing layers, even if the edited layer did not have
those restrictions.
This patch alters gimp_item_tree_view_effects_edited_clicked () so that
it checks if the edited filter's drawable is visible or pixel locked,
rather than the currently selected layers. It also adds checks in
GimpFilterTool tool to verify an existing filter is being edited before
preventing certain operations.
2024-12-19 17:42:43 +00:00
Bruno
5ea569e208
build: Explain why we bundle GTK locales 2024-12-19 13:54:29 -03:00
Bruno
2952039ea7
build/linux: Use custom App ID on Nightly flatpak
This avoids DEs mixing icons from stable/beta with nightly.
2024-12-19 09:16:25 -03:00
Aurimas Černius
a8c59a6926 Update Lithuanian translation 2024-12-19 10:00:51 +00:00
Anders Jonsson
70db83ee33 dialogs: remove border around toolbar icons in preferences 2024-12-18 20:48:00 +00:00
Jehan
277d49235f Issue #12576: crash when applying filter from history after an edit. 2024-12-18 13:53:52 +01:00
Jehan
f2cf2bfd04 gimp-data: bump the pointed data commit.
- More icons from Default used in legacy as temporary workaround of
  missing icons.
- Splash image updated.
2024-12-18 00:32:41 +01:00
Jehan
e81a6bfdc3 NEWS: update. 2024-12-18 00:21:41 +01:00
Jehan
363f37d866 plug-ins: also update the prompt when searching.
When searching backward, it will show '^^^' and forward 'vvv' instead of
'>>>' and also the searched text will appear next to the prompt between
parentheses. This makes searching a lot easier as we have clear feedback
of where we are at and what we are searching.
2024-12-18 00:16:06 +01:00
Jehan
70da73ee0d plug-ins: implement Ctrl-R and Ctrl-S in Python Console for searching.
These are the common shell shortcuts for respectively searching backward
and forward in command history. I use the Python Console plug-in so much
for testing that it started to weigh on me on how ineffective it was not
to be able to search through the history and laboriously hit Up/Down
buttons instead.

While doing a search, most navigation keys would trigger to stop the
search (and stay at the current history item followed by whatever the
key was supposed to do, such as changing cursor position, etc.). Esc in
particular would just stop the search and do nothing else.

Ctrl-C though would reset the search and get the text back to what it
was before search started.
2024-12-17 23:53:34 +01:00
Jehan
9588132849 plug-ins: do not cycle through Python Console history.
When you want to get back to the latest command, it is very confusing
when it starts cycling from the oldest history command!
2024-12-17 23:15:53 +01:00
Jehan
3284e9a487 NEWS: update.
As a particularity in these NEWS, the changes for BMP are more accurate
in the NEWS file than in the commit because MR !1932 got mistakenly
squashed. For anyone looking to have even more details, they should read
the informative comments in the MR:

https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/1932/commits
2024-12-17 21:12:52 +01:00
Jehan
aa2d35c5fc app, pdb, plug-ins: replace (plug-in-bump-map).
For plug-in writers reference, these are equivalent:

- (plug-in-bump-map RUN-NONINTERACTIVE img drawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0)
+ (let* ((filter (car (gimp-drawable-filter-new drawable "gegl:bump-map" ""))))
+   (gimp-drawable-filter-configure filter LAYER-MODE-REPLACE 1.0
+                                   "azimuth" azimuth "elevation" elevation "depth" depth
+                                   "offset-x" 0 "offset-y" 0 "waterlevel" 0.0 "ambient" 0.0
+                                   "compensate" FALSE "invert" FALSE "type" "linear"
+                                   "tiled" FALSE)
+   (gimp-drawable-filter-set-aux-input filter "aux" bump-layer)
+   (gimp-drawable-merge-filter drawable filter)
+ )

The "type" argument now uses strings.

This commit also do a big cleanup of remaining now-unused helper
functions in the compat PDB code.
2024-12-17 16:24:54 +00:00
Jehan
e2d7cc163e app, pdb, plug-ins: replace (plug-in-displace).
For plug-in writers reference, these are equivalent:

- (plug-in-displace RUN-NONINTERACTIVE work-image frame-layer
-                   x-displacement y-displacement
-                   TRUE TRUE aux1 aux2 abyss))
+ (let* ((abyss "black")
+        (filter (car (gimp-drawable-filter-new frame-layer "gegl:displace" ""))))
+
+   (if (= edge-type 1) (set! abyss "loop"))
+   (if (= edge-type 2) (set! abyss "clamp"))
+
+   (gimp-drawable-filter-configure filter LAYER-MODE-REPLACE 1.0
+                                   "amount-x" x-displacement "amount-x" y-displacement "abyss-policy" abyss
+                                   "sampler-type" "cubic" "displace-mode" "cartesian")
+   (gimp-drawable-filter-set-aux-input filter "aux" aux1)
+   (gimp-drawable-filter-set-aux-input filter "aux2" aux2)
+   (gimp-drawable-merge-filter frame-layer filter)
+ )

I also changed a test which (I think) was just a no-op since do-x and
do-y were 0 0 (hence FALSE). Therefore the whole filter processing was
ignored. Note though that unlike the rippling animation filter, I
haven't tested the test script.
2024-12-17 16:24:54 +00:00
Jehan
c663c8cd2d plug-ins: Script-fu (gimp-drawable-filter-set-aux-input) procedure.
This is a wrapper to the C function of the same name. It is now possible
to merge filters with auxiliary input pads!
2024-12-17 16:24:54 +00:00
Jehan
a6392ed84a app, libgimp, pdb, plug-ins: add a few Script-fu wrapper of libgimp filter API.
In particular (gimp-drawable-filter-configure),
(gimp-drawable-merge-filter) and (gimp-drawable-append-filter) are
proper Script-fu methods.

I had to rename the PDB procedures for the 2 latter because they were
clashing with these wrapper. I had not realized that private PDB
procedures are still visible by Script-fu. This is not so glop. :-/

Right now, it doesn't look so useful compared to the -new- one-liner
variant procedures. But it will make sense when I will add aux input C
procedure wrappers.
2024-12-17 16:24:54 +00:00
Jehan
6480ba2ad6 app, libgimp, pdb: new gimp_drawable_filter_set_aux_input() public API.
It is this way possible to set a drawable as auxiliary input to a filter
in C and GObject-Introspected bindings.

Note that such filters can only be merged, not appended
non-destructively for the time being.
2024-12-17 16:24:54 +00:00
Jehan
1fbd2acc84 app, pdb, plug-ins: get rid of (plug-in-rotate).
It can be reimplemented with (gimp-image-rotate) and
(gimp-item-transform-rotate-simple), with even more capabilities for the
latter.

The item rotate procedure is a bit more tricky though, since it takes
into account the selection. It means that either you want to just remove
the selection before (that's what I did here, because this script was
already losing the selection anyway), or you want to store the selection
(with (gimp-channel-copy)), then reapply it (very likely with
(gimp-channel-combine-masks)) at the end, after also rotating it
appropriately the same way as the image if needed.
2024-12-17 16:24:54 +00:00
Jehan
c26b2cd08f app, pdb, plug-ins: replace (plug-in-noisify).
For plug-in writers reference, these are equivalent:

- (plug-in-noisify RUN-NONINTERACTIVE theImage mLayer TRUE r g b a)
+ (gimp-drawable-merge-new-filter mLayer "gegl:noise-rgb" 0 LAYER-MODE-REPLACE 1.0
+                                 "independent" TRUE "red" r "green" g "blue" b "alpha" a
+                                 "correlated" FALSE "seed" (msrg-rand) "linear" TRUE)

Notes:

* When "independent" is FALSE, then you only need to set "red" (which is
  equivalent to a "value" field) and "alpha".
* Original plug-in was using the second value ('g', a.k.a. noise_2 in
  the PDB args) as alpha when the source drawable was grayscale. This
  logic is meaningless now. Just set "alpha".
* The PDB procedure was wrapping the operation between
  "gegl:cast-format" nodes to cast the input buffer to linear. This is
  useless as the "gegl:noise-rgb" has already a "linear" argument
  (defaulting to TRUE, but I specify it explicitly in this commit, for
  clarity) which requests linear input when set.
2024-12-17 16:24:54 +00:00
Jehan
dc4daa8396 app, pdb, plug-ins: replace (plug-in-emboss).
For plug-in writers reference, these are equivalent:

- (plug-in-emboss RUN-NONINTERACTIVE img mask-emboss 315.0 45.0 7 TRUE)
+ (gimp-drawable-merge-new-filter mask-emboss "gegl:emboss" 0 LAYER-MODE-REPLACE 1.0 "azimuth" 315.0 "elevation" 45.0 "depth" 7 "type" "emboss")

Note: the last arg, emboss, must be replaced by a string, "emboss" when
it was TRUE, "bumpmap" when FALSE.

Similarly to "gegl:gaussian-blur", the call to wrap_in_gamma_cast() was
useless because "gegl:emboss" already sets its output format to linear,
as well as its input format (through GeglOperationAreaFilter parent
class).
2024-12-17 16:24:54 +00:00
Jehan
cba5b2c4c6 plug-ins: fix a call to (gimp-drawable-offset).
GIMP_OFFSET_BACKGROUND doesn't exist since commit 2770cce833 and was
replaced by GIMP_OFFSET_COLOR + a specific GeglColor added in
gimp_drawable_offset().
2024-12-17 16:24:54 +00:00
Jehan
1c4a00de78 app, pdb, plug-ins: replace (plug-in-gauss).
For plug-in writers reference, these are equivalent:

- (plug-in-gauss RUN-NONINTERACTIVE image layer hblur vblur 0)
+ (gimp-drawable-merge-new-filter layer "gegl:gaussian-blur" 0 LAYER-MODE-REPLACE 1.0 "std-dev-x" hblur "std-dev-y" vblur "filter" "auto")

Note: the method arg { AUTO (0), FIR (1), IIR (2) } is transformed into
a string in lowercase. E.g. 1 becomes "fir".

At first, I was a bit annoyed by the wrap_in_gamma_cast() call which
converts the buffer to linear first, but looking at "gegl:gaussian-blur"
implementation, it is just a meta op to 2 "gegl:gblur-1d" which anyway
sets input format (to various formats, but always linear).

This legacy cast code must be a remnant from older times where it might
have been needed. Clearly it's not anymore.
2024-12-17 16:24:54 +00:00
Jehan
b0ac59b421 app, pdb, plug-ins: replace (plug-in-plasma).
This time, it's a Python plug-in, which is a bit more involved than C or
Script-fu usage (where we have variable args one-liner function) though
it's not too bad either. It's actually very similar (on purpose) to how
PDB procedures are run.
2024-12-17 16:24:54 +00:00
Jehan
082ba3bb1f app, pdb, plug-ins: replace (plug-in-waves).
For plug-in writers reference, these are equivalent:

- (plug-in-waves RUN-NONINTERACTIVE
-                image
-                source-layer
-                amplitude
-                phase
-                wavelength
-                0
-                FALSE)
+
+ (let* (
+       (phi phase)
+       (width (car (gimp-drawable-get-width source-layer)))
+       (height (car (gimp-drawable-get-height source-layer)))
+       (aspect (/ width height))
+       )
+
+   (while (< phi 0)
+     (set! phi (+ phi 360.0))
+   )
+   (set! phi (/ (- (modulo phase 360.0) 180.0) 180.0))
+
+   (if (< aspect 0.1)
+     (set! aspect 0.1))
+   (if (> aspect 10.0)
+     (set! aspect 10.0))
+   (gimp-drawable-merge-new-filter source-layer "gegl:waves" 0 LAYER-MODE-REPLACE 1.0 "amplitude" amplitude "phi" phi
+                                                                                      "period" (* wavelength 2.0)
+                                                                                      "clamp" TRUE "aspect" aspect)
+ )

Notes:

* The old type argument is the negated value of "clamp".
* The last argument (reflective) was unused.
2024-12-17 16:24:54 +00:00
Jehan
c70ffcec91 app, pdb, plug-ins: replace (plug-in-threshold-alpha).
For plug-in writers reference, these are equivalent:

- (plug-in-threshold-alpha RUN-NONINTERACTIVE image layer threshold))
+ (gimp-drawable-merge-new-filter layer "gimp:threshold-alpha" 0 LAYER-MODE-REPLACE 1.0 "value" (/ threshold 255))

The main difference is that threshold arg was a [0; 255] int whereas
"value" is a [0.0; 1.0] double.

This commit also shows how to run filters in C plug-ins (file-ico here)
as a one-liner too, thanks to the varargs conviency function.
2024-12-17 16:24:54 +00:00
Jehan
3c0c4db614 app, pdb, plug-ins: replace (plug-in-spread).
For plug-in writers reference, these are equivalent:

- (plug-in-spread RUN-NONINTERACTIVE image layer inSpread inSpread)
+ (gimp-drawable-merge-new-filter layer "gegl:noise-spread" 0 LAYER-MODE-REPLACE 1.0 "amount-x" inSpread "amount-y" inSpread "seed" (msrg-rand))
2024-12-17 16:24:54 +00:00
Jehan
5af02d292a app, pdb, plug-ins: replace (plug-in-solid-noise).
For plug-in writers reference, these are equivalent:

- (plug-in-solid-noise RUN-NONINTERACTIVE image layer FALSE TRUE seed 2 2 2)
+ (let* ((width  (cadddr (gimp-drawable-mask-intersect layer)))
+        (height (caddr (cddr (gimp-drawable-mask-intersect layer)))))
+   (gimp-drawable-merge-new-filter layer "gegl:noise-solid" 0 LAYER-MODE-REPLACE 1.0 "tileable" FALSE "turbulent" TRUE "seed" seed
+                                                                                     "detail" 2 "x-size" 2.0 "y-size" 2.0
+                                                                                     "width" width "height" height)
+ )
2024-12-17 16:24:54 +00:00
Jehan
093b09ccc6 app, pdb, plug-ins: replace (plug-in-oilify).
For plug-in writers reference, these are equivalent:

- (plug-in-oilify RUN-NONINTERACTIVE image active-layer mask-size 0)
+ (gimp-drawable-merge-new-filter active-layer "gegl:oilify" 0 LAYER-MODE-REPLACE 1.0 "mask-radius" (max 1 (/ mask-size 2)) "use-inten" FALSE)
2024-12-17 16:24:54 +00:00
Jehan
dfeab826ce app, pdb, plug-ins: replace (plug-in-maze).
For plug-in writers reference:

- (plug-in-maze RUN-NONINTERACTIVE image active-layer 5 5 TRUE 0 seed 57 1)
+ (gimp-drawable-merge-new-filter active-layer "gegl:maze" 0 LAYER-MODE-REPLACE 1.0 "x" 5 "y" 5 "tileable" TRUE "algorithm-type" "depth-first"
+                                                                                   "seed" seed
+                                                                                   "fg-color" (car (gimp-context-get-foreground))
+                                                                                   "bg-color" (car (gimp-context-get-background)))

Notes:

* FG and BG colors were hardcoded to current context colors. It also
  means with the new API, you can use whatever else you want.
* The algorithm arg changes like this:
  - 0 -> "depth-first"
  - 0 -> "prim"
* multiple and offset args (the 2 last args) were bogus and were doing
  nothing already.
2024-12-17 16:24:54 +00:00
Jehan
39c2b83746 libgimp: allow passing GeglParamSeed arguments from plug-ins.
In particular, I encountered some script-fu scripts calling some GEGL
ops with a seed, but this argument wouldn't be reproduced in the config
object. Technically it's just a uint. Let's just pass them as such.
2024-12-17 16:24:54 +00:00
Jehan
7e81bdfa14 app, pdb, plug-ins: replace (plug-in-edge).
For plug-in writers reference:

- (plug-in-edge RUN-NONINTERACTIVE image layer 2 1 0)
+ (gimp-drawable-merge-new-filter layer "gegl:edge" 0 LAYER-MODE-REPLACE opacity "amount" 2.0 "border-behavior" "loop" "algorithm" "sobel")

The warpmode (before-last) arg has to be replaced like this (types from
GeglAbyssPolicy enum type):

* NONE (0)  -> "none"
* WRAP (1)  -> "loop"
* SMEAR (2) -> "clamp"
* BLACK (3) -> "black"

For edgemode (last arg), just use the name value in lowercase as string:
{ SOBEL (0), PREWITT (1), GRADIENT (2), ROBERTS (3), DIFFERENTIAL (4), LAPLACE (5) }
E.g. "differencial" instead of formerly 4.
2024-12-17 16:24:54 +00:00
Jehan
4cc50c6701 app, pdb, plug-ins: replace (plug-in-cubism).
For plug-in developers reference:
- (plug-in-cubism RUN-NONINTERACTIVE image layer tile_size saturation 0)
+ (gimp-drawable-merge-new-filter layer "gegl:cubism" 0 LAYER-MODE-REPLACE 1.0 "tile-size" tile_size "tile-saturation" saturation "bg-color" '(0 0 0))

Now you can even choose the bg-color (not just an int/enum of black and
background color only).
2024-12-17 16:24:54 +00:00
Jehan
f539f8fb62 app, libgimp, pdb, plug-ins: plug-in-c-astretch compat PDB proc removed.
For plug-in writers, here is how to replace it:

- (plug-in-c-astretch RUN-NONINTERACTIVE img drawable)
+ (gimp-drawable-merge-new-filter drawable "gegl:stretch-contrast" 0 LAYER-MODE-REPLACE 1.0 "keep-colors" FALSE)
2024-12-17 16:24:54 +00:00
Jehan
e5134e67aa libgimp*, plug-ins: filter ID are now usable in script-fu.
Marshalled PDB procedures into script-fu can now convert a filter ID
into the proper object. For instance, here would be the code to append a
new gaussian blur filter to the drawable with ID 2 (with specific
settings), then making invisible:

```script-fu
(define filter (gimp-drawable-append-new-filter 2 "gegl:gaussian-blur" "hello" LAYER-MODE-COLOR-ERASE 1.0 "std-dev-x" 20 "abyss-policy" "none"))
(gimp-drawable-filter-set-visible filter FALSE)
(gimp-drawable-update 2 0 0 -1 -1)
```
2024-12-17 16:24:54 +00:00