You are here

Gimp Batch mode image quality

Hi Gimp Experts,

I tried to modify the basic1-logo.scm code from the gimp release to learn about the Gimp APIs. But the image it produced from batch mode looks very coarse. I suspect my gimp-file-save is wrong. Would you please help me to point out the problem?

I used gimp-2.6 -i -b - to run the function.

There are two function: text-effect and text-logo. I call tex-logo and it calls text-effect. If I do a gimp-display-new, the image on my gimp looks very nice and sharp. But after I called gimp-file-save and then took a look of the image, it looked pretty bad with fuzzy edges and unclear image.

Sincerely,
-student_101

(define (text-effect img logo-layer bg-color text-color)
(let* (
(width (car (gimp-drawable-width logo-layer)))
(height (car (gimp-drawable-height logo-layer)))
(bg-layer (car (gimp-layer-new img width height RGBA-IMAGE "Background" 100 NORMAL-MODE)))
(shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE "Shadow" 100 MULTIPLY-MODE)))
)
(gimp-context-push)
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img shadow-layer bg-layer)
(gimp-context-set-foreground text-color)
(gimp-layer-set-lock-alpha logo-layer TRUE)
(gimp-edit-fill logo-layer FOREGROUND-FILL)
(gimp-context-set-foreground '(255 255 255 ))
(gimp-context-set-background '(0 0 0))
(gimp-edit-blend bg-layer FG-BG-RGB-MODE MULTIPLY-MODE
GRADIENT-RADIAL 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
125 125 width height)
(gimp-edit-fill bg-layer BACKGROUND-FILL)
(gimp-edit-clear shadow-layer)

(gimp-context-pop)
)
)

(define (text-logo text
size
font
bg-color
text-color)
(let* (
(img (car (gimp-image-new 256 256 RGB)))
(text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font)))
(darker-layer 0)
)
(gimp-image-u ndo-disable img)
(gimp-context-set-background bg-color)
(gimp-edit-fill img BACKGROUND-FILL)
(text-effect img text-layer bg-color text-color)
(set! darker-layer
(car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)))
(gimp-image-undo-enable img)
(gimp-file-save
RUN-NONINTERACTIVE
img
darker-layer
"./my_image.jpg"
"./my_image.jpg"
) ) )

Forums: 
Subscribe to Comments for "Gimp Batch mode image quality"