Hello,
using: ImageMagick 6.8.9-8 Q16 x86_64 2016-05-05
on: OpenSUSE 13.2 64b
Is there a way to generate a gradient fill for the background in montage? I've only seen solid colours used in examples. And the default (white) is a little hard on the eyes...
I'd like to do a diagonal gradient from light grey to dark grey if that's possible? Can someone please instruct me here?
Thanks.
SOLVED - How to generate gradient background in montage?
- teracow
- Posts: 19
- Joined: 2013-04-30T02:55:12-07:00
- Authentication code: 6789
- Location: Brisbane, Australia
SOLVED - How to generate gradient background in montage?
Last edited by teracow on 2016-06-08T00:13:26-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to generate gradient background in montage?
set the background to none and composite the montage output over a gradient of the same size.
- teracow
- Posts: 19
- Joined: 2013-04-30T02:55:12-07:00
- Authentication code: 6789
- Location: Brisbane, Australia
Re: How to generate gradient background in montage?
So, I did this:
Works well!
Thanks Fred.
Code: Select all
#!/bin/bash
# build gallery
montage "*[0]" -background none -shadow -geometry 400x400 "gallery-foreground.png"
# get image dimensions
read -r width height <<< $(convert -ping "gallery-foreground.png" -format "%w %h" info:)
# create a black image with white sphere in centre
convert -size ${width}x${height} radial-gradient:white-black "gallery-background.png"
# overlay foreground on background
composite -gravity center "gallery-foreground.png" "gallery-background.png" "gallery-actual.png"
Thanks Fred.