### ImageMagick version

7.1.1-28

### Operating system

Windows

### Operating system, version and so on

Windows 11

### Description

There seems to be a bug in `-define gradient:direction=South gradient: ...`.


### Steps to Reproduce

```
magick -size 200x300 -define gradient:direction=South gradient:Red-Blue x.png
```
The result, x.png, is shown below.

The expected result is a smooth gradient from red at the top (y=0) to blue at the bottom (y=299). In fact, the image is blue at y=199.

The problem seems to be in paint.c, function GradientImage(), which includes:
```
        case SouthGravity:
        {
          gradient->gradient_vector.x1=0.0;
          gradient->gradient_vector.y1=0.0;
          gradient->gradient_vector.x2=0.0;
          gradient->gradient_vector.y2=(double) image->columns-1;
          break;
        }

```
The y2 line should be:
```
          gradient->gradient_vector.y2=(double) image->rows-1;

```
A workaround is to use `-define gradient:direction=North` with the colours in the opposite direction.



### Images

![x](https://github.com/ImageMagick/ImageMagick/assets/33812368/d4627de6-9d4a-4f58-bb87-3e4c0df6d88c)

-define gradient:direction=South gradient: ...
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : -define gradient:direction=South gradient: ...
Issue date:

--- start body ---
### ImageMagick version

7.1.1-28

### Operating system

Windows

### Operating system, version and so on

Windows 11

### Description

There seems to be a bug in `-define gradient:direction=South gradient: ...`.


### Steps to Reproduce

```
magick -size 200x300 -define gradient:direction=South gradient:Red-Blue x.png
```
The result, x.png, is shown below.

The expected result is a smooth gradient from red at the top (y=0) to blue at the bottom (y=299). In fact, the image is blue at y=199.

The problem seems to be in paint.c, function GradientImage(), which includes:
```
        case SouthGravity:
        {
          gradient->gradient_vector.x1=0.0;
          gradient->gradient_vector.y1=0.0;
          gradient->gradient_vector.x2=0.0;
          gradient->gradient_vector.y2=(double) image->columns-1;
          break;
        }

```
The y2 line should be:
```
          gradient->gradient_vector.y2=(double) image->rows-1;

```
A workaround is to use `-define gradient:direction=North` with the colours in the opposite direction.



### Images

![x](https://github.com/ImageMagick/ImageMagick/assets/33812368/d4627de6-9d4a-4f58-bb87-3e4c0df6d88c)

--- end body ---
