AppleScript:将图像切成两半?
是否可以使用 AppleScript 将图像切成两半并单独保存?
Is it possible to cut an image in the half using AppleScript and save them seperately?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 ImageMagick 会更容易。这会将左半部分保存为
input-0.png
,将右半部分保存为input-1.png
:这会将右半部分保存为
right.png< /code>:
+repage
删除旧画布大小的元数据。请参阅http://www.imagemagick.org/Usage/crop/。您可以使用
brew install imagemagick
或sudo port install imagemagick
安装 ImageMagick。It would be easier to use ImageMagick. This saves the left half as
input-0.png
and the right half asinput-1.png
:This saves just the right half as
right.png
:+repage
removes metadata for the old canvas size. See http://www.imagemagick.org/Usage/crop/.You can install ImageMagick with
brew install imagemagick
orsudo port install imagemagick
.如果您无法访问可编写脚本的图像编辑应用程序(如 Photoshop 中的应用程序),则可以使用 Mac OS X 附带的图像事件来裁剪图像。要获取图像的尺寸,只需使用类似以下的内容...
...裁剪图像的命令就像简单的
如果,碰巧你有 Photoshop,那么裁剪的处理方式
会有所不同 :命令,但这些是必需的参数。其他应用程序很可能有不同的实现(可能更像苹果的)。只需选择您选择的图像编辑应用程序,然后仔细阅读词典以了解其工作原理。
You can use Image Events, which comes with Mac OS X to crop an image if you don't have access to a scriptable image-editing application (as in Photoshop). To get the dimensions of the image just use something like the following...
...and the command to crop the image is as simple as
If, by chance, you have Photoshop, then cropping is handled differently:
There is more to the command but those are the required parameters. Other applications will most likely have a different implementation (probably more like Apple's). Just select your image-editing app of choice, and peruse the Dictionary to see how it works.