testing percent colors in HSL and HSB IM 6.5.6-6 Q16

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

testing percent colors in HSL and HSB IM 6.5.6-6 Q16

Post by fmw42 »

Things seem to be working correctly for this change in IM 6.5.6-6 Q16 beta.


# txt: is producing hue now in percent
# HSL
convert colorswatch.png -scale 1x1! -colorspace HSL txt:-# ImageMagick pixel enumeration: 1,1,65535,hsl
0,0: ( 2299,34588,56283) #08FB871CDBDB hsl(3.50805%,52.7779%,85.8824%)
# HSB
convert colorswatch.png -scale 1x1! -colorspace HSB txt:-# ImageMagick pixel enumeration: 1,1,65535,hsb
0,0: ( 2299,10464,61166) #08FB28E0EEEE hsb(3.50805%,15.967%,93.3333%)


#Each of these produces the correct result.
# percent HSL
convert -size 100x100 xc:"hsl(3.50877%,52.7779%,85.8824%)" colorswatch_hsl7a.png
# raw HSL (H 0-360, S,L 0-255)
convert -size 100x100 xc:"hsl(12.6316,134.5836,219.0001)" colorswatch_hsl7b.png

#Each of these produces the correct result.
# percent HSB
convert -size 100x100 xc:"hsb(3.50877%,15.967%,93.3333%)" colorswatch_hsb7a.png
# raw HSB (H 0-360, S,B 0-255)
convert -size 100x100 xc:"hsb(12.6316,40.7159,237.9999)" colorswatch_hsb7b.png

#Each of these correctly produces pure green
# percent HSL
convert -size 100x100 xc:"hsl(33.333%, 100%, 50%)" show:
# raw HSL
convert -size 100x100 xc:"hsl(120, 255, 127)" show:

# percent HSB
convert -size 100x100 xc:"hsb(33.333%, 100%, 100%)" show:
#raw HSB
convert -size 100x100 xc:"hsb(120, 255, 255)" show:


I have modified the color.php page to reflect these changes.
Post Reply