Annotate images using tools built into OS X

三世轮回 提交于 2019-12-24 19:28:56

问题


I want to overlay text on images on OS X, preferably without installing additional software, so that, as a sysadmin, I can know at a glance that machines are up-to-date, in a way that is easily scriptable and easily modifiable, and can run without GUI access. [Being able to overlay images or apply color-changing effects would be a bonus.]

Mac OS X Leopard comes with a ton of stuff built-in: Perl, Python, Ruby, Tcl/Tk, Bash; wxWidgets, some Quartz integration, and even Objective-C integration for Python and Ruby. There must be several good ways to do this, if I were only versed in these systems.

I'm continuing to go through the examples in the /Developer folder on my computer, and I have got a partial idea of how this might be done in Cocoa and converted to PyObjC. I decided I would have to deploy ImageMagick, but in my testing, I am running into an infamous bus error, and would prefer not to have to compile ImageMagick or GraphicsMagick with all its dependancies if I can do what I need to out-of-the-box. [That said, I would consider installing additional components, but it would be a big win to have something that would work on a stock install of OS X].


回答1:


This seems like it'd be relatively simple to do using Python and the Python Imaging Library (PIL). I don't think PIL is installed with OS X by default, but it's relatively easy to install manually and doesn't have a ton of dependencies. The PIL tutorials are also pretty good -- it shouldn't be too hard to whip up a command-line or GUI program to do what you want.




回答2:


CocoaMagic is a single-file replacement for large parts of RMagick (Ruby integration with ImageMagick or GraphicsMagick). It should be useable as a library in its own right, or by appending things to the bottom of the script.



来源:https://stackoverflow.com/questions/1229171/annotate-images-using-tools-built-into-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!