### ImageMagick version

7.1.1-26

### Operating system

MacOS

### Operating system, version and so on

macOS 14.1.1

### Description

Converting an sRGB image to Adobe98, DisplayP3 or ProPhoto using `-colorspace` results in pixel values multiplied by QuantumRange, and converting an Adobe98, DisplayP3 or ProPhoto image to sRGB divides the input values by QuantumRange.


### Steps to Reproduce

With the Q16 HDRI build from Homebrew:

```shellsession
$ magick -depth 8 canvas:'srgb(100%,0%,0%)' -colorspace display-p3 txt:-
# ImageMagick pixel enumeration: 1,1,0,255,displayp3
0,0: (15333601,3347367,2315759)  #FFFFFF  displayp3(6.01318e+06%,1.31269e+06%,908141%)

$ magick -depth 8 canvas:'display-p3(100%,0%,0%)' -colorspace srgb txt:-
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (0,0,0)  #000000  srgb(0.00186884%,-6.41763e-05%,-2.99722e-05%)

$ # These are the correct results
$ magick -depth 8 canvas:'srgb(100%,0%,0%)' -colorspace display-p3 -evaluate divide 65535 txt:-
# ImageMagick pixel enumeration: 1,1,0,255,displayp3
0,0: (234,51,35)  #EA3323  displayp3(91.7552%,20.0304%,13.8573%)

$ magick -depth 8 canvas:'display-p3(100%,0%,0%)' -evaluate multiply 65535 -colorspace srgb txt:-
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (279,0,0)  #FF0000  srgb(109.299%,-54.3388%,-25.3778%)
```

With a Q32 HDRI build:

```shellsession
$ magick -depth 8 canvas:'srgb(100%,0%,0%)' -colorspace display-p3 txt:-
# ImageMagick pixel enumeration: 1,1,0,255,displayp3
0,0: (1004918212358,219376405103,151767922687)  #FFFFFF  displayp3(3.9408558e+11%,8.6029965e+10%,5.9516832e+10%)

$ magick -depth 8 canvas:'display-p3(100%,0%,0%)' -colorspace srgb txt:-
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (0,0,0)  #000000  srgb(2.8515823e-08%,-9.7923726e-10%,-4.5733248e-10%)

$ magick -depth 8 canvas:'srgb(100%,0%,0%)' -colorspace display-p3 -evaluate divide 4294967295 txt:-
# ImageMagick pixel enumeration: 1,1,0,255,displayp3
0,0: (234,51,35)  #EA3323  displayp3(91.755199%,20.030412%,13.857342%)

$ magick -depth 8 canvas:'display-p3(100%,0%,0%)' -evaluate multiply 4294967295 -colorspace srgb txt:-
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (279,0,0)  #FF0000  srgb(109.29903%,-54.338837%,-25.377825%)
```


### Images

_No response_
Conversion from/to Adobe98, DisplayP3 or ProPhoto yields incorrect results
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Conversion from/to Adobe98, DisplayP3 or ProPhoto yields incorrect results
Issue date:

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

7.1.1-26

### Operating system

MacOS

### Operating system, version and so on

macOS 14.1.1

### Description

Converting an sRGB image to Adobe98, DisplayP3 or ProPhoto using `-colorspace` results in pixel values multiplied by QuantumRange, and converting an Adobe98, DisplayP3 or ProPhoto image to sRGB divides the input values by QuantumRange.


### Steps to Reproduce

With the Q16 HDRI build from Homebrew:

```shellsession
$ magick -depth 8 canvas:'srgb(100%,0%,0%)' -colorspace display-p3 txt:-
# ImageMagick pixel enumeration: 1,1,0,255,displayp3
0,0: (15333601,3347367,2315759)  #FFFFFF  displayp3(6.01318e+06%,1.31269e+06%,908141%)

$ magick -depth 8 canvas:'display-p3(100%,0%,0%)' -colorspace srgb txt:-
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (0,0,0)  #000000  srgb(0.00186884%,-6.41763e-05%,-2.99722e-05%)

$ # These are the correct results
$ magick -depth 8 canvas:'srgb(100%,0%,0%)' -colorspace display-p3 -evaluate divide 65535 txt:-
# ImageMagick pixel enumeration: 1,1,0,255,displayp3
0,0: (234,51,35)  #EA3323  displayp3(91.7552%,20.0304%,13.8573%)

$ magick -depth 8 canvas:'display-p3(100%,0%,0%)' -evaluate multiply 65535 -colorspace srgb txt:-
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (279,0,0)  #FF0000  srgb(109.299%,-54.3388%,-25.3778%)
```

With a Q32 HDRI build:

```shellsession
$ magick -depth 8 canvas:'srgb(100%,0%,0%)' -colorspace display-p3 txt:-
# ImageMagick pixel enumeration: 1,1,0,255,displayp3
0,0: (1004918212358,219376405103,151767922687)  #FFFFFF  displayp3(3.9408558e+11%,8.6029965e+10%,5.9516832e+10%)

$ magick -depth 8 canvas:'display-p3(100%,0%,0%)' -colorspace srgb txt:-
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (0,0,0)  #000000  srgb(2.8515823e-08%,-9.7923726e-10%,-4.5733248e-10%)

$ magick -depth 8 canvas:'srgb(100%,0%,0%)' -colorspace display-p3 -evaluate divide 4294967295 txt:-
# ImageMagick pixel enumeration: 1,1,0,255,displayp3
0,0: (234,51,35)  #EA3323  displayp3(91.755199%,20.030412%,13.857342%)

$ magick -depth 8 canvas:'display-p3(100%,0%,0%)' -evaluate multiply 4294967295 -colorspace srgb txt:-
# ImageMagick pixel enumeration: 1,1,0,255,srgb
0,0: (279,0,0)  #FF0000  srgb(109.29903%,-54.338837%,-25.377825%)
```


### Images

_No response_
--- end body ---
