Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 命令行(甚至以编程方式)检索图像的部分_Linux_Bash_Command Line - Fatal编程技术网

Linux 命令行(甚至以编程方式)检索图像的部分

Linux 命令行(甚至以编程方式)检索图像的部分,linux,bash,command-line,Linux,Bash,Command Line,我有一个在服务器(linux)上进行屏幕截图处理的应用程序,特别是我想将图像分割成4或6个部分。图像可能有4个图像(每个象限一个)。那么,有没有一种方法可以使用命令行工具来拆分它?在其他一些情况下是六个。让我们假设我将知道要将图像剪切成多少 那么,是否有一个命令行实用程序来执行此操作?无论映像大小如何,都必须有linux实用程序来执行此操作。我画的是空白。使用imagemagick可以将图像拆分为平铺,例如: convert -crop <width>%x<height>

我有一个在服务器(linux)上进行屏幕截图处理的应用程序,特别是我想将图像分割成4或6个部分。图像可能有4个图像(每个象限一个)。那么,有没有一种方法可以使用命令行工具来拆分它?在其他一些情况下是六个。让我们假设我将知道要将图像剪切成多少


那么,是否有一个命令行实用程序来执行此操作?无论映像大小如何,都必须有linux实用程序来执行此操作。我画的是空白。

使用
imagemagick
可以将图像拆分为平铺,例如:

convert -crop <width>%x<height>%@ original_file.png  tile_%d.png
对于六块瓷砖:

convert -crop 50%x33%@ original_file.png  tile_%d.png
(或
33%x50%@
如果水平方向有三个)

工具
convert
可能有一种简单的方法来实现这一点
convert -crop 50%x33%@ original_file.png  tile_%d.png