英文:
Imagemagick: fill white color dimension taken from GIMP
问题
Here's the translated part of your text:
以下是要翻译的内容:
假设有以下图片。我想要用白色填充带有字母 ry
的部分(ry
只是一个示例问题)。可以使用以下命令来完成:
mogrify -fill white -draw "rectangle <坐标, 大小>" *.jpg
我想知道如何将在 GIMP 中选择的 ry
部分的图像“转换”为 imagemagick
可以理解的内容?换句话说,给定在 GIMP 中制作的选择,我应该在 <坐标, 大小>
中使用什么值?
根据您的请求,我展示了 GIMP 坐标的样子:
在使用 GIMP 坐标时,我使用以下命令来裁剪图像:mogrify -crop 0x0+4248+6336 *.jpg
其中:
- 0 - 左边的位置
- 0 - 右边的位置
- 4248 - 左边的大小
- 6336 - 右边的大小
也许这对您有所帮助。
英文:
Say there is a following image. I'd like to fill the part with letters ry
with white color (ry
is an example for a question). It can be done by the following command:
mogrify -fill white -draw "rectangle <coordinates, size>" *.jpg
I'd like to know how do I "convert" selection of ry
part of the image from GIMP to be understood by imagemagick
? In other words, given selection made in GIMP, what values do I use instead of <coordinates, size>
?
As per request, I show how GIMP coordinates look:
On a side node, I use the following command to crop image using mogrify
when using coordinates from GIMP mogrify -crop 0x0+4248+6336 *.jpg
where 0 -> position from left, 0 -> position from right
4248 -> size from left, 6336 -> size from right
Perhaps this helps.
答案1
得分: 0
If I assume your coordinates are top-left corner, width and height, then there are two ways to fill white in Imagemagick. The first is to overlay a white image. The second is to draw a white rectangle.
Overlay White Image:
convert ry.jpg -size 389x260 xc:white -geometry +1179+486 -compose over -composite result.jpg
- -size specifies the size of the white image
- -geometry specifies the top left corner of the white image in the background image
Draw White Rectangle:
convert ry.jpg -fill white -draw "rectangle 1179,486 1568,746" -alpha off result2.jpg
The top-left corner and the bottom-right corner coordinates are used
英文:
If I assume your coordinates are top-left corner, width and height, then there are two ways to fill white in Imagemagick. The first is to overlay a white image. The second is to draw a white rectangle.
Overlay White Image:
convert ry.jpg -size 389x260 xc:white -geometry +1179+486 -compose over -composite result.jpg
-size specifies the size of the white image
-geometry specifies the top left corner of the white image in the background image
Draw White Rectangle:
convert ry.jpg -fill white -draw "rectangle 1179,486 1568,746" -alpha off result2.jpg
The top-left corner and the bottom-right corner coordinates are used
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论