I wrote a bash script that's taking card stats off a csv file and using imagemagick to add them to the appropriate image in the correct location. As of right now, all I've seen are solid colors by name and picking rgb values. Maybe there's a simple way to do this, but I either didn't see it, or didn't recognize the answer in my searching. If anyone has any suggestions, I'd greatly appreciate it. Thanks!
- Posts: 26294
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Do you need to know how to specify colors? See https://imagemagick.org/script/color.php
Or do you need to know how to put two colors onto the top and bottom of the image?
Post your original image. Also provide your IM version and platform (whenever asking questions, since syntax may vary).
Make an image that is white on the top half and light gray on the bottom half. Then do a -compose multiply -composite to combine it with your original.
- Posts: 755
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
This first command creates two labels with the same text, one white on black and the other gray on black. Both labels are cropped horizontally into two equal parts. Then the bottom half of the white label and the top half of the gray one are deleted. Finally the remaining two parts are appended. The result is a transparent background with text that is white from the top down to half way, and gray from the half way line to the bottom.
Code: Select all
convert -pointsize 48 -background black -fill white label:"ABC 1 2 3" \ -fill gray label:"ABC 1 2 3" -crop 1x2@ -delete 1,2 -append twotone.png
The next command here creates a single label, white on transparent, then uses "-sparse-color" to fill it with white down to H*0.4, and gray from H*0.6 to the bottom. That makes a bit of gradient between H*0.4 and H*0.6 where the colors meet in the middle.
Code: Select all
convert -background none -pointsize 48 -fill white label:"ABC 1 2 3" -trim \ -channel RGB -sparse-color barycentric "0,%[fx:h*0.4] white 0,%[fx:h*0.6] gray" twotone.png
More information about your exact needs would help us give you better options.