imagemagick:创建一个.png文件,它只是一个实心矩形 [英] imagemagick: create a .png file which is just a solid rectangle

查看:111
本文介绍了imagemagick:创建一个.png文件,它只是一个实心矩形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个纯色的.png文件.

I want to create a .png file which is just a solid color.

使用ImageMagick做到这一点必须很容易,但我无法找出问题所在:

This must be easy to do using ImageMagick but I can't figure out the problem:

C:\tmp>convert -size 8x16 -stroke black -fill black -draw "rectangle 0,0,8,16" black.png
Magick: missing an image filename `black.png' @ error/convert.c/ConvertImageComm
and/3016.

推荐答案

显然可以有更多选择,例如边框等,但是如果您只想要宽度x高度为给定十六进制颜色的图像,那就很简单了

Obviously there can be more options, like borders and etc, but if you just want an image of width x height of a given hex color, it's pretty straight forward.

这里是制作100x100的深红色固体图像的全部步骤:

Here's all it takes to make an 100x100 image of a solid dark red:

convert -size 100x100 xc:#990000 whatever.png

这篇关于imagemagick:创建一个.png文件,它只是一个实心矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆