fmw42 wrote:I believe that this works with 16-bit hex values. Snibgo, correct me if I am wrong.
Your result is like mine: it gives graduation in alpha but not colour.
Further experiments show this happens when the value of either alpha is zero. If neither alpha is zero, we get graduation in both alpha and colour, which is what I would always expect.
Code: Select all
convert -size 1x10 gradient:rgba(10,20,30,0.1)-rgba(20,30,40,0.8) txt:
# ImageMagick pixel enumeration: 1,10,65535,srgba
0,0: (3.92157%,7.84314%,11.7647%,0.0999924) #0A0A14141E1E1999 srgba(3.92157%,7.84314%,11.7647%,0.0999924)
0,1: (5.88235%,9.80392%,13.7255%,0.177768) #0F0F191923232D82 srgba(5.88235%,9.80392%,13.7255%,0.177768)
0,2: (6.64988%,10.5715%,14.493%,0.255543) #11061B10251A416B srgba(6.64988%,10.5715%,14.493%,0.255543)
0,3: (7.05882%,10.9804%,14.902%,0.333333) #12121C1C26265555 srgba(18,28,38,0.333333)
0,4: (7.31365%,11.2352%,15.1568%,0.411109) #12B91CC326CD693E srgba(7.31365%,11.2352%,15.1568%,0.411109)
0,5: (7.48608%,11.4076%,15.3292%,0.488884) #132A1D34273E7D27 srgba(7.48608%,11.4076%,15.3292%,0.488884)
0,6: (7.61273%,11.5343%,15.4559%,0.566659) #137D1D8727919110 srgba(7.61273%,11.5343%,15.4559%,0.566659)
0,7: (7.70733%,11.6289%,15.5505%,0.64445) #13BB1DC527CFA4FA srgba(7.70733%,11.6289%,15.5505%,0.64445)
0,8: (7.7821%,11.7037%,15.6252%,0.722225) #13EC1DF62800B8E3 srgba(7.7821%,11.7037%,15.6252%,0.722225)
0,9: (7.84314%,11.7647%,15.6863%,0.8) #14141E1E2828CCCC srgba(20,30,40,0.8)
A workaround, to get graduation in both colour and alpha where one end is fully transparent, is to make a separate graduation for alpha:
Code: Select all
convert -size 1x10 gradient:#000-#2b0140 gradient:black-white -compose CopyOpacity -composite txt:
# ImageMagick pixel enumeration: 1,10,65535,srgba
0,0: (0%,0%,0%,0) #0000000000000000 none
0,1: (1.87381%,0.0442512%,2.78935%,0.111116) #04CC001D07241C72 srgba(1.87381%,0.0442512%,2.78935%,0.111116)
0,2: (3.74762%,0.0869764%,5.57717%,0.222217) #099800390E4738E3 srgba(3.74762%,0.0869764%,5.57717%,0.222217)
0,3: (5.62142%,0.131228%,8.36652%,0.333333) #0E640056156B5555 srgba(5.62142%,0.131228%,8.36652%,0.333333)
0,4: (7.49523%,0.173953%,11.1543%,0.44445) #133000721C8E71C7 srgba(7.49523%,0.173953%,11.1543%,0.44445)
0,5: (9.36751%,0.218204%,13.9437%,0.55555) #17FB008F23B28E38 srgba(9.36751%,0.218204%,13.9437%,0.55555)
0,6: (11.2413%,0.260929%,16.7315%,0.666667) #1CC700AB2AD5AAAA srgba(11.2413%,0.260929%,16.7315%,0.666667)
0,7: (13.1151%,0.30518%,19.5209%,0.777783) #219300C831F9C71C srgba(13.1151%,0.30518%,19.5209%,0.777783)
0,8: (14.9889%,0.347906%,22.3087%,0.888884) #265F00E4391CE38D srgba(14.9889%,0.347906%,22.3087%,0.888884)
0,9: (16.8627%,0.392157%,25.098%,1) #2B2B01014040 srgba(43,1,64,1)