imagemagick Convert -crop 前面带有管道
我想使用 imagemagick 裁剪图像。 但是,imagemagick 将接收图像数据并通过之前的管道进行裁剪:
exiftool -b -RawThermalImage image1.jpg | convert .....-crop.....
我不确定要在“.....-crop.....”中放入什么,以将接收到的图像数据裁剪为特定的区域。请指导。
通常,在转换后,会指定一个图像进行裁剪,如下所示:
convert rose: -crop 1x1+3+3 cropped.gif
但是,在这种情况下,鉴于图像是从管道传入的,我对如何完成此命令感到困惑。
图片链接: https://drive.google.com/file/d/14h3z0yFK_9_f2puzbhLUm3D50MDMMnu2/查看?usp=共享
I want to use imagemagick to crop an image.
However, imagemagick will be receiving the image data to crop through a pipe before it:
exiftool -b -RawThermalImage image1.jpg | convert .....-crop.....
I am not sure what to put in the ".....-crop.....", to crop the image data received to a specific area. Please guide.
Usually, after convert, an image is specified for cropping like:
convert rose: -crop 1x1+3+3 cropped.gif
But, in this case, I am confused as to how to complete this command given that the image is coming in from the pipe.
ImageLink:
https://drive.google.com/file/d/14h3z0yFK_9_f2puzbhLUm3D50MDMMnu2/view?usp=sharing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新答案
事实证明,问题是由于无意中使用GraphicsMagick而不是ImageMagick引起的。
原始答案
如果该流具有众所周知的幻数(签名),您应该能够使用破折号
-
来引用stdin
在开始时:如果流是原始的,或者没有已知的幻数/签名,则需要给 ImageMagick 一个提示,因此如果它是具有形状的原始灰度 8 位数据640x480,使用:
如果是大小为80x80的RGB888数据,则使用:
Updated Answer
It transpires that the problem was caused by inadvertently using GraphicsMagick rather than ImageMagick.
Original Answer
You should be able to use a dash
-
to refer to thestdin
if that stream has a well-known magic number (signature) at the start:If the stream is raw, or doesn't have a known magic number/signature, you will need to give ImageMagick a hint, so if it is raw greyscale 8-bit data with shape 640x480, use:
If it's RGB888 data with size 80x80, use: