1
0
Fork 0
gimp/plug-ins/script-fu/test/tests/PDB/image/image-mode.scm
Daniel Baumann 554424e00a
Adding upstream version 3.0.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-23 00:14:50 +02:00

61 lines
1.9 KiB
Scheme

; test combinations of mode conversion
; COLOR=>GRAY=>INDEXED=>GRAY
; Since 3.0rc3, getters of color profile are private to libgimp
; setup
(define testImage (testing:load-test-image "gimp-logo.png"))
; test image is RGB
(assert `(= (car (gimp-image-get-base-type ,testImage))
RGB))
; convert RGB=>GRAY
(assert `(gimp-image-convert-grayscale ,testImage))
; mode conversion was effective
(assert `(= (car (gimp-image-get-base-type ,testImage))
GRAY))
; effective color profile is the built-in one for GRAY
;(assert `(= (vector-length (car (gimp-image-get-effective-color-profile ,testImage)))
; 544))
; convert GRAY=>INDEXED
(assert `(gimp-image-convert-indexed
,testImage
CONVERT-DITHER-NONE
CONVERT-PALETTE-GENERATE
25 ; color count
1 ; alpha-dither. FUTURE: #t
1 ; remove-unused. FUTURE: #t
"myPalette" ; ignored
))
; mode conversion was effective
(assert `(= (car (gimp-image-get-base-type ,testImage))
INDEXED))
; effective color profile is the built-in one for COLOR
;(assert `(= (vector-length (car (gimp-image-get-effective-color-profile ,testImage)))
; 672))
; convert INDEXED=>GRAY
(assert `(gimp-image-convert-grayscale ,testImage))
; mode conversion was effective
(assert `(= (car (gimp-image-get-base-type ,testImage))
GRAY))
; effective color profile is the built-in one for GRAY
;(assert `(= (vector-length (car (gimp-image-get-effective-color-profile ,testImage)))
; 544))
; convert GRAY=>COLOR
(assert `(gimp-image-convert-rgb ,testImage))
; mode conversion was effective
(assert `(= (car (gimp-image-get-base-type ,testImage))
RGB))
; effective color profile is the built-in one for RGB
;(assert `(= (vector-length (car (gimp-image-get-effective-color-profile ,testImage)))
; 672))