EXR to JPG with vertical background gradient

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
keljnr
Posts: 11
Joined: 2018-10-16T03:29:47-07:00
Authentication code: 1152

EXR to JPG with vertical background gradient

Post by keljnr »

I have a script which adds a background gradient to exr then converts to a jpg (changing colorspace along the way). Only issues is that I'm wanting a vertical linear gradient.
The following code gives me a diagonal gradient.

How can I change this to show as a vertical gradient?

Code: Select all

cd %~dpnx1
for %%a in (.) do set currentfolder=%%~na
start cmd /c magick *exr* null: ( -clone 0--2 -sparse-color bilinear 0,0,'#34465d',%%[fx:w-1],%%[fx:h-1],black ) -colorspace RGB -colorspace sRGB -compose DstOver -layers Composite "%currentfolder%.pdf"
Many thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: EXR to JPG with vertical background gradient

Post by snibgo »

snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EXR to JPG with vertical background gradient

Post by fmw42 »

change %%[fx:w-1] to 0 and change bilinear to barycentric. See https://imagemagick.org/Usage/canvas/#t ... _gradients
Post Reply