with the convert utility, how can I create a png image that is:
* 1px in height
* 3px in width
* pixel[0] is red
* pixel[1] is green
* pixel[2] is blue
?
How would I create a 1x3 png with three rgb pixels?
-
- Posts: 7
- Joined: 2016-11-08T21:03:34-07:00
- Authentication code: 1151
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: How would I create a 1x3 png with three rgb pixels?
patrick99e99 wrote:with the convert utility, how can I create a png image that is [...]
Code: Select all
convert xc:#FF0000[1x1] xc:#00FF00[1x1] xc:#0000FF[1x1] +append rgb.png
-
- Posts: 7
- Joined: 2016-11-08T21:03:34-07:00
- Authentication code: 1151
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How would I create a 1x3 png with three rgb pixels?
This is sufficient:
IM assumes 1x1 pixel if not specified by -size
Code: Select all
convert xc:#FF0000 xc:#00FF00 xc:#0000FF +append rgb.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How would I create a 1x3 png with three rgb pixels?
Just to be even more minimalist, colours can be specified by only three hex digits. IM replicated the digits as required.
Code: Select all
convert xc:#F00 xc:#0F0 xc:#00F +append rgb.png
snibgo's IM pages: im.snibgo.com
Re: How would I create a 1x3 png with three rgb pixels?
This is fine for Windows but on *nix the "#" will comment out the remainder of the line.
So, on *nix, use one of these:
Code: Select all
magick xc:#F00 xc:#0F0 xc:#00F +append rgb.png
Code: Select all
magick xc\#F00 xc:\#0F0 xc:\#00F +append rgb.png
magick xc:"#F00" xc:"#0F0" xc:"#00F" +append rgb.png
magick xc:red xc:lime xc:blue +append rgb.png