Ah, that's easy.
Code: Select all
convert red_bg.jpg -modulate 100,100,20.0976 blue_bg.png
Where did "20.0976" come from?
Code: Select all
convert large_0266443.jpg -resize 1x1! -colorspace HSL txt:
# ImageMagick pixel enumeration: 1,1,255,hsl
0,0: (153,247, 21) #99F715 hsl(59.8901%,96.9818%,8.39399%)
convert red_bg.jpg -crop 20x20+402+123 -resize 1x1! -colorspace HSL txt:
# ImageMagick pixel enumeration: 1,1,255,hsl
0,0: (255,213, 85) #FFD555 hsl(99.8413%,83.5035%,33.4463%)
The blue background has an average hue of 59.8901%. A small patch of the red is hue=99.8413%. (Examination with the Gimp eyedropper tells me all the reds have the same hue, and the greys really are grey.) We want a change of:
99.8413 - 59.8901 = 39.9512%, or 0.399512 as a fraction of one.
For the modulate command, a delta hue of 200 is a "full circle", 360 degrees. So we want a delta hue of 0.399512 * 200. But the base isn't zero, it is 100. (Give it a value of 100 or 300 and we get no change in hue. 0 and 200 gives us 180 degree rotation of hue.)
100 - 0.399512 * 200 = 20.0976. QED.