我正在尝试在 gimp 中实现插件调色板映射(此插件将指定可绘制对象的内容与活动调色板进行映射。)以在命令行中使用。Gimp GUI 菜单选项:颜色-> 映射-> 调色板映射。但它抛出错误。我如何选择活动调色板来处理图像?
(define (batch-color-palette pattern)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE
filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(plug-in-palettemap RUN-NONINTERACTIVE
image drawable)
(gimp-file-save RUN-NONINTERACTIVE
image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
我收到错误:
GIMP-Error: Calling error for procedure 'gimp-palette-entry-get-color':
Palette 'Standard' not found
我尝试读取活动调色板。但没有成功。你能帮忙吗?
答案1
问题是我使用了带有 -d 选项的 gimp 命令。需要删除它,以便调色板和数据也包含在处理中。
gimp -i -b batch-color-palette.....
gimp 的详细信息批处理模式页面