07-04-2025, 10:23 AM
(This post was last modified: 07-04-2025, 10:25 AM by programmer_ceds.)
(07-03-2025, 08:20 PM)Ofnuts Wrote: The Script-fu browser doc also says that gimp-drawable-get-pixel returns a GeglColor, even if it doesn't document any way to extract data from this.
That's what it says but the following code works in V3.0.4 in an scm file in the plug-ins folder:
Code:
; Check if a pixel is opaque - it is not opaque if it lies outside the bounds of the unrotated image
;
(define (pixel_is_opaque x y)
(let* (
(result FALSE)
(pixel_value '())
)
(if (and (>= x 0) (< x width) (>= y 0) (< y height))
(begin
(set! pixel_value (gimp-drawable-get-pixel inLayer x y))
(if (= (cadddr pixel_value) 255)
(set! result TRUE)
) ; end - if
) ; end - begin
) ; end - if
(list
result
)
) ; end - let
) ; end - define
The full code is available in https://programmer97.byethost10.com/File...cm_GV3.scm
I seem to remember a commit in this area but can't currently find it.
The GIMP activation line is:
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=gimp-3.0 --file-forwarding org.gimp.GIMP @@u %U @@ --pdb-compat-mode=warn
I don't suppose that it makes any difference but the pdb-compat-mode refers to this sort of area.