Page 1 of 1

Command to create this simple image?

Posted: 2016-05-13T18:07:58-07:00
by Severian
Hi, I'm trying to use imageMagick to create this:
Image
(just the colors, the numbers are for reference)

My goal is to compare it with the same image created by a program I made. I tried reading convert usage but, being honest, I ended up confused and without a clue.

So, is there a command that can directly create this?

Thanks in advance

Re: Command to create this simple image?

Posted: 2016-05-13T18:23:59-07:00
by snibgo
Something like this:

Code: Select all

convert -size 50x50 ( xc:blue xc:lime +append ) ( xc:red xc:white +append ) -append -bordercolor black -border 2 x.png

Re: Command to create this simple image?

Posted: 2016-05-13T18:51:41-07:00
by Severian
Cool, that didn't work (syntax error on "(" or something like that) but following the idea I managed to do it.

Thanks a lot!

Re: Command to create this simple image?

Posted: 2016-05-13T19:08:30-07:00
by snibgo
You didn't say what shell you used. If you had problems with "(" then I deduce you use bash, so should escape parentheses.

Code: Select all

convert -size 50x50 \( xc:blue xc:lime +append \) \( xc:red xc:white +append \) -append -bordercolor black -border 2 x.png

Re: Command to create this simple image?

Posted: 2016-05-13T19:18:10-07:00
by Severian
Yeah, forgot about that. Thank you very much!

Re: Command to create this simple image?

Posted: 2016-05-13T19:40:01-07:00
by fmw42
Please always provide your IM version and platform when asking questions, since syntax differs.

See viewtopic.php?f=1&t=9620, which is the top-most link on this forum.