|
@@ -213,7 +213,9 @@
|
|
(define (magick-alpha-channel-options)
|
|
(define (magick-alpha-channel-options)
|
|
(alpha-channel-list))
|
|
(alpha-channel-list))
|
|
|
|
|
|
-(define* (magick-convert-image image-bytes #:key format alpha-channel)
|
|
|
|
|
|
+(define* (magick-convert-image image-bytes #:key
|
|
|
|
+ format
|
|
|
|
+ alpha-channel)
|
|
(call-with-magick-wand
|
|
(call-with-magick-wand
|
|
(lambda (wand)
|
|
(lambda (wand)
|
|
(MagickReadImageBlob* wand image-bytes)
|
|
(MagickReadImageBlob* wand image-bytes)
|
|
@@ -224,16 +226,18 @@
|
|
(MagickGetImageBlob* wand))))
|
|
(MagickGetImageBlob* wand))))
|
|
|
|
|
|
(define* (magick-create-image #:key width height
|
|
(define* (magick-create-image #:key width height
|
|
- (format "PNG")
|
|
|
|
- (background-color "white")
|
|
|
|
- (background-alpha 0.0)
|
|
|
|
|
|
+ format
|
|
|
|
+ background-color
|
|
|
|
+ background-alpha
|
|
alpha-channel)
|
|
alpha-channel)
|
|
(call-with-magick-wand
|
|
(call-with-magick-wand
|
|
(lambda (wand)
|
|
(lambda (wand)
|
|
(call-with-pixel-wand
|
|
(call-with-pixel-wand
|
|
(lambda (background)
|
|
(lambda (background)
|
|
- (PixelSetColor background background-color)
|
|
|
|
- (PixelSetAlpha background background-alpha)
|
|
|
|
|
|
+ (when background-color
|
|
|
|
+ (PixelSetColor background background-color))
|
|
|
|
+ (when background-alpha
|
|
|
|
+ (PixelSetAlpha background background-alpha))
|
|
(MagickNewImage wand width height background)))
|
|
(MagickNewImage wand width height background)))
|
|
(when format
|
|
(when format
|
|
(MagickSetImageFormat wand format))
|
|
(MagickSetImageFormat wand format))
|